Skip to content
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

Nodejs Inspector not stopping at breakpoints #85

Closed
govindrai opened this issue Feb 26, 2018 · 13 comments
Closed

Nodejs Inspector not stopping at breakpoints #85

govindrai opened this issue Feb 26, 2018 · 13 comments

Comments

@govindrai
Copy link

I have the debugger keyword placed in multiple places in my file, and have even added manual breakpoints in the inspector UI. Still, executing the file does not stop at any breakpoints. I am using node 9.2.0 and chrome 64.0.3282.167.

Here is a picture of how my devtools appears.
screen shot 2018-02-26 at 10 24 56 am

@alexkozy
Copy link

What flag do you use to start Node with inspector? --inpsect or --inspect-brk?

@govindrai
Copy link
Author

govindrai commented Feb 26, 2018

@ak239 I ran it with --inspect. --inspect-brk makes it work! If you have the time, could you explain why the inspector cannot pick up breakpoints without it? Super appreciate your quick reply!

@alexkozy
Copy link

We are working on better workflow here but for now --inspect-brk is only one way.
With --inspect-brk node waits DevTools frontend connection. On connection DevTools send all breakpoints information and starts JavaScript execution in node.
With --inspect node starts JavaScript execution without waiting for DevTools frontend. As soon as DevTools connected, we send the same breakpoint information to node but it can be too late since some JavaScript is already executed.

@govindrai
Copy link
Author

govindrai commented Mar 2, 2018

Thank you for you help! Closing this!

Update as of 12/27/2018: All comments below are unrelated to my issue, but the title of this issue was relevant so it generated some comments. They were some breaking builds where inspect-brk was not working, but is now resolved. It seemed that the debugger was buggy :D.

However, the overarching solution still holds: Use inspect-brk to ensure breakpoints are not missed.

@tasoss
Copy link

tasoss commented Aug 24, 2018

Hello.
Because of the fact that inspect brk doesn't work , what do u propose?
I mean this thing used to work and it was great.It's really hard to debug on big projects.
Does changing node or chrome can solve this so at least,i will be able to debug?
Thanks!

@paramsinghvc
Copy link

What's the solution here. Why is it closed?
@ak239 Can you please suggest some workaround for the same. The debugger is not pausing on the breakpoints in chrome devtool.

@llwanghong
Copy link

llwanghong commented Nov 29, 2018 via email

@paramsinghvc
Copy link

In Chrome Canary 72, it works. @llwanghong

@viksok
Copy link

viksok commented Feb 8, 2019

Updated to Chrome 72.0.3626.96 /Ubuntu yesterday and it stopped working.
Neither --inspect nor --inspect-brk doesn't work.

@Gobliins
Copy link

Gobliins commented Feb 19, 2019

Missing breakpoints sometimes on Win Chrome Version 72.0.3626.109 (Official Build) (64-Bit)

@june07
Copy link

june07 commented May 21, 2019

https://blog.june07.com/nim-custom-devtools-url explains a solution to this. Often the problem is due to breaking changes with DevTools. Using NiM allows you to lock the DevTools version whilst still using the most recent version of Chrome.

@alexkozy
Copy link

I suggest to use latest Chrome DevTools and file a bug on crbug.com when something does not work. In this case you get all new features and help other developers to get best experience.

Latest Node 12 should work well with latest Chrome DevTools frontend. Here is a link how to use dedicated devtools frontend: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27

@june07
Copy link

june07 commented May 23, 2019

Couldn't agree with @ak239 more.

With NiM I can use DevTools latest or a different version if I need, so while I'm filing my bug on crbug.com, I'm not blocked and can continue my own work:
https://i.imgur.com/ofYxhQo.gif

I like using the latest and greatest version of DevTools whenever possible because the DevTools team is always improving it! As Paul brings out in the Youtube link ak239 shared: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27, tools like NiM simply help in using the Chrome DevTools workflow.

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

8 participants