-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
Version
v24.4.0
Platform
Microsoft Windows NT 10.0.26100.0 x64
Subsystem
REPL
What steps will reproduce the bug?
Launch powershell and type "node" to open the REPL, then type "let" and any letter after that will initiate the crash
2025-07-11_00-37-27.mp4
How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior? Why is that the expected behavior?
The repl doesn't crash and allows variable declaration
What do you see instead?
The repl crashes with the following error
node:internal/readline/emitKeypressEvents:74
throw err;
^
TypeError: Cannot read properties of null (reading 'start')
at findExpressionCompleteTarget (node:repl:1722:68)
at REPLServer.complete (node:repl:1487:55)
at REPLServer.completer (node:repl:792:5)
at showCompletionPreview (node:internal/repl/utils:233:10)
at showPreview (node:internal/repl/utils:389:7)
at REPLServer.self._ttyWrite (node:repl:1037: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)
Additional information
It seems like the following code is responsible for the crash, somehow lastDeclarationInit
is null. If it helps at all I downloaded node via fnm
Lines 1718 to 1724 in 5576dec
// If the last statement is a variable declaration statement the last declaration is | |
// what we can potentially complete on, so let's re-run the function's logic on that | |
if (lastBodyStatement.type === 'VariableDeclaration') { | |
const lastDeclarationInit = lastBodyStatement.declarations.at(-1).init; | |
const lastDeclarationInitCode = code.slice(lastDeclarationInit.start, lastDeclarationInit.end); | |
return findExpressionCompleteTarget(lastDeclarationInitCode); | |
} |
intentionally-left-nil, Rudxain, nodech, iczero, woess and 2 more
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.