vscode-js-debug
vscode-js-debug copied to clipboard
URL breakpoints don't bind on Node 8
I am trying to use debugger for a Dockerized Node Typescript project. I set the breakpoints to the lines where i wish to debug the code but the breakpoint doesnt bind. Basically the breakpoint changes from solid red to outlined grey. I have set the port and exposed it in both dockerfile and docker compose.
This is my start script:
"start": "node -r source-map-support/register ./node_modules/.bin/nodemon --inspect=0.0.0.0:9229 ./build/server.js",
This is my launch.json :
{ "version": "0.2.0", "configurations": [ { "name":"sphinx-api", "type": "node", "request": "attach", "restart":true, "port":9229, "localRoot": "${workspaceFolder}/sphinx-api", "remoteRoot": "/api", "trace": true, "resolveSourceMapLocations": [ "${workspaceFolder}/**", "!**/node_modules/**" ], } ] }
This is my tsconfig.json file:
{ "compileOnSave": true, "compilerOptions": { "lib": ["es2015","es2016","es2017"], "suppressImplicitAnyIndexErrors": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "moduleResolution": "node", "noImplicitReturns": false, "noEmitOnError": true, "strictNullChecks": true, "traceResolution": false, "noUnusedLocals": true, "noUnusedParameters": false, "noImplicitAny": true, "alwaysStrict": true, "strict": true, "module": "commonjs", "outDir": "./build", "baseUrl": "./src", "target": "es2017", "inlineSourceMap": true, "allowJs": true, "pretty": true, }, "include": [ "./package.json", "./tsconfig.json", "./src/**/*" ], "paths": { "src/*" : ["./src/**/*"] }, "types": [ "@types/underscore" ] }
Below I have attached the images of Debugger getting attached and troubleshooting log of unbound breakpoint. I am not sure why is it not setting and the code executes but it doesnt stop at breakpoint. It was working fine 3 4 days back.
Any help would be appreciated.
vs code version: 1.83 Node version: 8.9.4 Typescript version: 2.6.2
If you're able to, add
"trace": true
to yourlaunch.json
and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to [email protected]
Also, your Node version is ancient (end of life was almost 4 years ago) and has known issues. You may want to upgrade at some point.
@connor4312 we are currently running this project on production, so wont be able to migrate as of this point. I have shared the log file to your email.
It looks like this bug is due to differing behavior in the version of V8 included with Node 8. Its "URLs" are actually paths like "/api/foo/bar.js"
instead of "file:///api/foo/bar.js"
.
@connor4312 Meanwhile is there a way around that i can use to get on with the debugger?
You can install the nightly version of the debugger, right click and pick "Install Another Version", and then install an older version. Versions <=2023.8.*
should work for you.
works like charm! Thanks
Greetings @connor4312 , I've the exact same problem (debugger not working w/ node 8). I've installed <=2023.8.* (even went back to 2019.11.*) but still not working. Any alternatives?
Greetings, any updates on this one?
If <=2023.8.*
does not work, you are hitting a different issue. Please create a new issue in this repo using the template. Though I strongly recommend upgrading Node.js first to see if the problem goes away, as there are many known issues with Node 8.
Upgrading node fixes it. But our project is still in node 8 and this extensions declares that minimum supported version is node 8.x. Should the min. supported version of vscode-js-debug be updated then to reflect which engines it supports? Or the incompatibility w/ the node 8 will be fixed?
@connor4312 the nightly version isn't working now either. Any update on this?
Greetings @connor4312 . Any updates on this one?
Greetings @connor4312 . Any updates on this one? I know the current supported version is node 8.x. If a fix on this issue is not planned to be delivered, should the lowest supported version of the extension be updated the lowest that actually works?
Greetings @connor4312 . Any updates on this?
Greetings @connor4312 , any updates on this?
Greetings @connor4312 , any updates on this?
I don't plan to fix this. Node 8's reached its end of life date over 5 years ago, there many limitations to its debugging functionality, and practically there are a miniscule number of users still on it. Newer and supported LTS releases have been available for 6 years.
If you need to debug in Node 8, I recommend switching back to a much older nightly release. This debugger was released shortly after Node 8 hit end of life at which time we had decent support for it.