Node repl crashes when trying to call back a large multiline item
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript, linux, node.js
- 领域
- cli
调研方向
首先,使用一个较大的多行 JSON 项在 Node REPL 中重现崩溃,然后检查 internal/readline/interface 中的 _multilineMove 和 _moveUpOrHistoryPrev,以及 node:repl。重复两次向上箭头操作后不会抛出报告中的 TypeError,也不会导致 REPL 崩溃,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Version
24.4.1
Platform
Linux panta-rog 6.14.0-27-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 17:01:58 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Paste a huge multi-line JSON into repl.
Then bring it back via arrow up.
Then press arrow up again.
How often does it reproduce? Is there a required condition?
I can reproduce it with a long JSON.
What is the expected behavior? Why is that the expected behavior?
No crash.
What do you see instead?
TypeError: Cannot read properties of undefined (reading 'length')
at REPLServer.[_multilineMove] (node:internal/readline/interface:1092:36)
at REPLServer.[_moveUpOrHistoryPrev] (node:internal/readline/interface:1149:27)
at REPLServer.[_ttyWrite] [as _ttyWrite] (node:internal/readline/interface:1498:37)
at REPLServer.self._ttyWrite (node:repl:1035:9)
at ReadStream.onkeypress (node:internal/readline/interface:284:20)
at ReadStream.emit (node:events:507:28)
at ReadStream.emit (node:domain:489:12)
at emitKeys (node:internal/readline/utils:371:14)
at emitKeys.next (<anonymous>)
at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)
Additional information
No response
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/node 的其他 Issue
-
doc
难度 2/5 1-3 小时 新手友好度 65/100
-
build
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1 小时以内 新手友好度 90/100
-
feature request
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
code-quality refactoring
难度 2/5 1-3 小时 新手友好度 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
难度 2/5 1-3 小时 新手友好度 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
难度 2/5 1-3 小时 新手友好度 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 88/100