Sitelet https://github.com/nodejs/node/issues/41792
Skip to content

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

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-

Activity

  1. changed the title [-]Syntax error not showing in node 12+[/-] [+]Syntax error not showing in `node inspect` in node 12+[/+] on Jan 31, 2022
  2. hybrist commented on Jan 31, 2022

    @hybrist
    Contributor

    This also reproduces with node --inspect-brk. The difference is that there the console API is forwarded to the DevTools. But in the terminal, the error is silently omitted.

    I think swallowing the stderr output when attaching a remote debugger is likely a bug and worth fixing.

  3. changed the title [-]Syntax error not showing in `node inspect` in node 12+[/-] [+]Syntax error not showing in stderr with `node --inspect-brk` in node 12+[/+] on Jan 31, 2022
  4. added
    inspectorIssues and PRs related to the V8 inspector protocol.
    on Jan 31, 2022
  5. github-actions commented on Jun 27, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 210 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  6. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jun 27, 2026
  7. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
    If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions