-
Notifications
You must be signed in to change notification settings - Fork 296
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
Breakpoint is failing on nodemon + jest + docker / compose setup #1617
Comments
We are using docker-compose's volumes to mount local files to remote, so when we save to local file, the changes are reflected in the container, and that will trigger nodemon to restart our jest unit tests. The remote path might have been messed up by mounting the volumes. |
Verification steps:
|
…child of remoteRoot Fixes #1617 If the url in a sourcemap is relative, assume we've already mapped the compiledPath, and don't map again.
This will be fixed in the nightly build on Monday after 5PM PST. Please let me know if it works for you. |
…child of remoteRoot Fixes #1617 If the url in a sourcemap is relative, assume we've already mapped the compiledPath, and don't map again.
Confirmed on nightly, bp is working. |
marking as verified based on @yuguan91's comment |
Describe the bug
Breakpoints fails to work on nodemon + jest + docker. Sometimes I get a breakpoint at wrong line numbers in a readonly file with the same name, sometimes no breakpoints at all.
My local files are located in /User/me/some/path/app
Inside docker container, the files are located in root
'/app'
I have a prelaunch task:
where ./scripts/start-app.sh essentially does:
And an attach configuration:
Debugger is able to attach to the process, because break point does hit the first line of
resolve()
in path.js. Butdebugger
statement doesn't work, nor does any break points.I've got the vscode-js-debug nightly extension, and debugged it to a point where I think I found the cause:
When using jest, my code is getting compiled to add instrumentation. The source map somehow already has the original local path, so when _onScriptParsed calls rebaseRemoteToLocal() the following happens:
I've added a branch statement in this function to check if remotePath already contains localRoot (and removeRoot is a substring of localRoot)
And that seemed to fix my issue.
To Reproduce
Steps to reproduce the behavior:
jest: 26.4.2
Log File
Will send logs to your email
VS Code Version:
Version: 1.76.2 (Universal)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:54:09.061Z (2 wks ago)
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin x64 22.3.0
Sandboxed: No
Additional Context:
I upgraded from 1.59 to 1.76, since debugger hasn't worked with our old setup after 1.59, until today I have the time for the upgrade. The regression might have happened anywhere in between.
The text was updated successfully, but these errors were encountered: