Node: "ReferenceError: v8debug is not defined" when doing remote debug

Created on 2 Jun 2016  路  11Comments  路  Source: nodejs/node

  • Version: v6.2.0
  • Platform: Darwin user_redacted 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
  • Subsystem: v8debug

Got following stack trace when debugging remotely. Not sure what functionality breaks, so far I'm able to debug normally.

What does it mean / how to get rid of it?

Command used to run node: $ /usr/local/bin/node --debug-brk=56203 app.js

ReferenceError: v8debug is not defined
    at eval (eval at <anonymous> (/Users/user_redacted/src/appname_redacted/service/svcname-redacted.js:1:1), <anonymous>:44:21)
    at eval (eval at <anonymous> (/Users/user_redacted/src/appname_redacted/service/svcname-redacted.js:1:1), <anonymous>:86:5)
    at /Users/user_redacted/src/appname_redacted/service/svcname-redacted.js:1:1
    at Object.exports.runInThisContext (vm.js:54:17)
    at Module._compile (module.js:513:28)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/user_redacted/src/appname_redacted/routes/index.js:1:83)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/user_redacted/src/appname_redacted/app.js:30:14)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
debugger

Most helpful comment

bnoordhuis is right, just add --expose_debug_as=v8debug to the "Node parameters" text field until JetBrains fixes the issue permanently.

All 11 comments

Hard to say what your program is doing exactly but it probably expects that --expose_debug_as=v8debug is passed on the command line.

I see no indication that this is a node.js core issue so I'll close the bug report but feel free to ask more questions.

I am getting the same exception too. I am using WebStorm and debugging it through it's debugger. This was working fine until pretty much today. I've reinstalled v6.2.0, exception still exists. I then installed v6.1.0, then exception is gone, works fine. Then reinstalled v6.2.0 and the exception came back.

I assume this is a bug within the package my index.js works fine until I am requiring my module - which is a simple class (function, not even ES6) in it's current form.
If I comment out this very basic require line, exception is gone.

HTH

@gerrytan are you using the latest WebStorm by any chance?

It's possible #6599 has something to do with it. v8debug was used internally until v6.2.0. It sounds like WebStorm might be depending on it being there?

@bnoordhuis by the looks of it you are right. I am getting the exception in WebStorm debugger console but not in terminal. Will raise it with them, thanks!

For those who are interested: here's the bug filed already at WebStorm, fix is coming with the 2016.2 release

bnoordhuis is right, just add --expose_debug_as=v8debug to the "Node parameters" text field until JetBrains fixes the issue permanently.

Hello.
any idea on how to do that ?

Thanks

Philippe

Run->Edit configuration->Create a node configuration. One of the options you can supply is the one described above.

Done.

Thanks

thanks guys!

This stopped it from giving the ReferenceError, but including --expose_debug_as=v8debug in the arguments makes it not hit breakpoints.

I am using angular-cli (ng serve) which does not expose node (runs it internally) any ideas on how to add that flag?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanjunzhi picture fanjunzhi  路  3Comments

stevenvachon picture stevenvachon  路  3Comments

addaleax picture addaleax  路  3Comments

willnwhite picture willnwhite  路  3Comments

Icemic picture Icemic  路  3Comments