Node inspect in chrome does not show source files - node.js

Node inspect does not show source code to debug in chrome devtools.
I tried to run code using command
node --inspect server.js
then i opened chrome://inspect/#devices
and then clicked Open dedicated DevTools for Node.
But this doesn't show up my server.js file but shows recently opened files in devtools.

Found the problem. There is an issue in chrome. Here is the link of the issue https://bugs.chromium.org/p/chromium/issues/detail?id=941608#c15
By updating chrome into beta version, solve my problem.

Related

Issues with breakpoints in ts-node

I faced a very strange problem. I have two working PC and one of them stop breaking on the breakpoints in one day. Another PC works properly the same as before.
I tried to reinstall Node JS, ts-node and then even hard reset for windows (I use Windows) but without any success.
Then I thought that probably issue in my project and I tried to clone hello world project from google tutorial and I found that I still can't debug with it!
So I successfully run an app on my port but breakpoint won't hit. This stop working in VS Code, in WebStorm and even Chrome debugger.
This is how I run an app: "C:\Program Files\nodejs\node.exe" --inspect --require ts-node/register C:\Projects\node-typescript-starter-master\src\index.ts
Then I opened dev tools from chrome and I see this:
Then I pressed "inspect" and I see message in console:
Debugger attached. Debugger listening on ws://127.0.0.1:9229/8bae9408-867c-4278-9148-b6c90b35a8ae For help, see: https://nodejs.org/en/docs/inspector Debugger attached.
This is the next window. Seems like I missing any files overhere.
Does this mean that something is wrong with my file mapping ?
Please, let me any suggestion what can be a problem.
Well, one of workaround is to don't use ts-node and just use default node js debugger config from WebStorm with adding TypeScript prelaunch compilation script.
Here is a screenshot how to configure:

Chrome DevTools for node: How to stop in specific file

I try to debug a grunt task with Chrome DevTools on Windows using the following command
node --inspect-brk node_modules\grunt\bin\grunt
This works nicely and the Chrome debugger stops in the root grunt javascript. But of course, I do not want to debug grunt, but my own "gruntfile.js". How can I set a breakpoint into that file, as it is not loaded yet?
I tried to add my project folder in the Chrome DevTools under "FileSystem", but whatever I add there as a breakpoint does not stop.

Can't debugging Type Script in chrome with node js

I have three files in ./
main.ts
main.js
main.js.map
I am doing node inspect-brk ./main.js,
opening chrome, typing chrome://inspect
Debugger is in the pause state.
I press F10 to make a step.
The problem is that chrome dev tools can't see ts file.
All settings in chrome that allows to see source maps are settled.
Chrome writes that Source Map detected and instructs me to add associated files in tree.
I have tried to add main.ts in workspace but chrome don't want to jump into it.
What do I have to do to walk through ts code?
Node.js version is v8.0.0
Chrome 59.0.3071.86
Type Script 2.3

Node's --inspect debugger not showing all source files

When I debug my script using --inspect, most of the sources show up, but many (seemingly arbitrarily) do not.
Is there any way to get my debugger to load all the source files, or has anyone ran into a similar problem?
Running node 9.1.1
Have tried reinstalling node.
Have tried clearing restoring defaults in the settings of chrome dev tools.
Have tried manually adding folder to workplace, on click nothing happens.

node inspector -brk not working

I am trying to use node-inspector with a simple script. I have some console logs in place so I can tell if it's running or not. I have tried 2 ways:
node-debug test.js
With this approach, the debugger opens in chrome, but does not break and runs without giving me a chance to enter break points.
In terminal window #1:
~ $ node-inspector
Node Inspector v0.9.2
Visit http://127.0.0.1:8080/debug?port=5858 to start debugging.
Open debugger in chrome. In terminal window #2:
node --debug-brk test.js
The script seems to be waiting, but the debugger window I opened has nothing going on, So I refresh the page. As soon as I do, I see my console logs (not breaking).
I'm running OSX Yosemite (10.10.1), Node.js v0.12.0, NPM 2.5.1, and Node-inspector v0.9.2.
Any ideas why this is happening?
This is a known bug when running on Node v0.12 and io.js, see https://github.com/node-inspector/node-inspector/issues/534

Resources