node.js - Is there any way to load files to Chrome when debugging node scripts -


currently it's possible debug node scripts using chrome described here. however, if run this:

node --inspect --debug-brk myscript  

it load myscript browser , i'll able put breakpoints in file. suppose myscript requires anotherscript , want put breakpoint in script. don't see how can done since chrome inspector loaded myscript.

is there way load file chrome inspector before files required in script , chrome loads itself?

i'm modifying sources , put debugger; statement there works. thinking should more apt purpose.

it seems it's not possible.

one possible solution avoid modifying sources put breakpoint @ end of script. in way chrome time breakpoint reached , execution paused chrome have loaded relevant files. can open file using ctrl+p , put breakpoint there. chrome keeps breakpoints between sessions if use open dedicated chrome devtool node option:

enter image description here

then restart node application. see more details in this make more efficient @ debugging webpack unspecified build errors article.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -