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

URL breakpoints don't bind on Node 8 #1848

Open
Muhammad406 opened this issue Oct 16, 2023 · 17 comments
Open

URL breakpoints don't bind on Node 8 #1848

Muhammad406 opened this issue Oct 16, 2023 · 17 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@Muhammad406
Copy link

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

Screenshot 2023-10-16 at 11 15 28 PM

Screenshot 2023-10-16 at 11 15 49 PM

Screenshot 2023-10-16 at 11 16 36 PM

@connor4312
Copy link
Member

If you're able to, add "trace": true to your launch.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 connor@xbox.com

@connor4312 connor4312 added the info-needed Issue requires more information from poster label Oct 16, 2023
@connor4312
Copy link
Member

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.

@Muhammad406
Copy link
Author

@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.

@connor4312
Copy link
Member

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 connor4312 added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Oct 16, 2023
@connor4312 connor4312 self-assigned this Oct 16, 2023
@connor4312 connor4312 added this to the Backlog milestone Oct 16, 2023
@Muhammad406
Copy link
Author

@connor4312 Meanwhile is there a way around that i can use to get on with the debugger?

@connor4312 connor4312 changed the title Unbound Breakpoint: Breakpoints not setting and getting greyed out when debugger is attached URL breakpoints don't bind on Node 8 Oct 17, 2023
@connor4312
Copy link
Member

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.

@Muhammad406
Copy link
Author

works like charm! Thanks

@federico-r-figueredo
Copy link

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?

@federico-r-figueredo
Copy link

Greetings, any updates on this one?

@connor4312
Copy link
Member

connor4312 commented Oct 30, 2023

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.

@federico-r-figueredo
Copy link

federico-r-figueredo commented Nov 8, 2023

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?

@Muhammad406
Copy link
Author

@connor4312 the nightly version isn't working now either. Any update on this?

@federico-r-figueredo
Copy link

Greetings @connor4312 . Any updates on this one?

@federico-r-figueredo
Copy link

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?

@federico-r-figueredo
Copy link

Greetings @connor4312 . Any updates on this?

@federico-r-figueredo
Copy link

Greetings @connor4312 , any updates on this?

1 similar comment
@federico-r-figueredo
Copy link

Greetings @connor4312 , any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants