Version
25
Platform
Subsystem
No response
What steps will reproduce the bug?
- The module
- Run
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
What: Don't exit.
Why: Because it should watch.
What do you see instead?
Node bails out with exit code 0.
% node --watch .
file:/// ... /index.mjs:2
SyntaxError: Unexpected end of input
at compileSourceTextModule (node:internal/modules/esm/utils:357:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:109:18)
at #translate (node:internal/modules/esm/loader:564:20)
at afterLoad (node:internal/modules/esm/loader:614:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:619:12)
at #createModuleJob (node:internal/modules/esm/loader:643:36)
at #getJobFromResolveResult (node:internal/modules/esm/loader:353:34)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:318:41)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:685:25)
Node.js v25.0.0
Failed running '.'. Waiting for file changes before restarting...
Additional information
Similar to #62021
Version
25
Platform
Subsystem
No response
What steps will reproduce the bug?
node --watch .How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
What: Don't exit.
Why: Because it should watch.
What do you see instead?
Node bails out with exit code
0.% node --watch . file:/// ... /index.mjs:2 SyntaxError: Unexpected end of input at compileSourceTextModule (node:internal/modules/esm/utils:357:16) at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:109:18) at #translate (node:internal/modules/esm/loader:564:20) at afterLoad (node:internal/modules/esm/loader:614:29) at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:619:12) at #createModuleJob (node:internal/modules/esm/loader:643:36) at #getJobFromResolveResult (node:internal/modules/esm/loader:353:34) at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:318:41) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:685:25) Node.js v25.0.0 Failed running '.'. Waiting for file changes before restarting...Additional information
Similar to #62021