Skip to content

Syntax error not showing in stderr with node --inspect-brk in node 12+ #41792

Open
@eliba2

Description

@eliba2

HI,
I'm trying a simple script with a syntax error in it but I'm not getting the error displayed when running with node versions 12+. Older versions are ok. I've tried this script (in test.js):

console.log(1)
console.log(2
console.log(3)

When running with node 11, I'm seeing the error:

# node-inspect test.js
< Debugger listening on ws://127.0.0.1:9229/9f22bef2-a0db-4c2d-89d6-f741e1f3c9cd
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
< /test.js:2
< console.log(1
<             ^
< SyntaxError: missing ) after argument list
<     at Module._compile (internal/modules/cjs/loader.js:760:23)
<     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
<     at Module.load (internal/modules/cjs/loader.js:685:32)
<     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
<     at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
<     at internal/main/run_main_module.js:21:11
< Waiting for the debugger to disconnect...
debug>

But with node 12+ (tried 13,14) the error is not echoed in the terminal and I'm getting:

/ # node-inspect test.js
< Debugger listening on ws://127.0.0.1:9229/583b30fe-ab2d-43f9-af41-a23d0148c985
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
< Waiting for the debugger to disconnect...
debug>

I would like to get the error echoed in the terminal. Is this a valid output or I'm doing anything wrong?
Thanks-

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions