Skip to content

"ReferenceError: v8debug is not defined" when doing remote debug #7102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gerrytan opened this issue Jun 2, 2016 · 11 comments
Closed

"ReferenceError: v8debug is not defined" when doing remote debug #7102

gerrytan opened this issue Jun 2, 2016 · 11 comments

Comments

@gerrytan
Copy link

gerrytan commented Jun 2, 2016

  • 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)
@mscdex mscdex added the debugger label Jun 2, 2016
@bnoordhuis
Copy link
Member

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.

@benqus
Copy link

benqus commented Jun 2, 2016

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?

@bnoordhuis
Copy link
Member

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?

@benqus
Copy link

benqus commented Jun 2, 2016

@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

@vdavid
Copy link

vdavid commented Jun 5, 2016

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

@PhilippeCorreges
Copy link

Hello.
any idea on how to do that ?

Thanks

Philippe

@pbrickell
Copy link

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

@PhilippeCorreges
Copy link

Done.

Thanks

@quantuminformation
Copy link

thanks guys!

@k-funk
Copy link

k-funk commented Aug 1, 2016

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

@born2net
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants