-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
sourcemaps + remote debugging issues #2183 #2472
Comments
@jin-chong Where do you keep the source maps? Are they inlined in the generated code? If not did you verify that the source map is up to date? |
Thanks for your reply Weinand, Yes, I get up to date Sourcemap. I've compiled it by tsc and I cannot find inline sourcemap option of tsc, so I just set "sourcemap: true" at tsconfig.json. You can test it like below:
FYI, when I simulate remote debug at the same Ubuntu ( by set "address" to "localhost"), it works fine. Weinard. I love Windows and really want to run VSC on Windows but I have to run demon on Ubuntu. Thanks a lot! |
Still problems with 1.2.1. You set breakpoint in the .ts file, the debugger stops when the breakpoint is hit, but the "red dot" in the ts file is moved to the corresponding line in the js file. How we can help? |
@delfinof it would help a lot if you could produce a screen recording that shows what you are doing and how and when the "red dot" moves. |
Remote debugging scenarios with source maps are a bit special and VS Code support for this is weak.
|
I guess the bug linked by me above, related to the node.js debugger extension, describes the same problem. I prepared a simple project here for easily testing the "jump in breakpoints" via Docker for Windows / Mac. My guess is that via the debugger, visual studio code receives some kind of update to the position of the breakpoints, and thinks they are relative to the "typescript source" instead of the "compiled javascript". It is worth nothing that:
|
@delfinof thanks a lot for creating that example project in github. With it I was able to reproduce and understand the problem. The issue is unrelated to Docker and will occur in any setup that uses source maps and Sorry about that. The fix will be available in the next Insiders build. |
@weinand Thanks! We all that work with remote hosts in order to have a configuration server (say a VM, Docker container, etc) as similar as a production server will thank you for this fix. |
This thread is a bit confusing. |
I have a (possibly unrelated) comment: I found that the debugger would fail to resolve breakpoints on linux. However if I caught the debugger on a panic stop I could open files on the stack and successfully put breakpoints in them. |
@wnichols by default node.js resolves sym links which results in the failing breakpoint matching. Try launching node.js with the "--preserve-symlinks" option. |
I was trying inlined sources with remote debugging and noticed some issue with sourcemaps. I went back to try out regular sourcemaps with remote debugging and hit issues as well.
Basic scenario
Get the repro from here.
On machine A (MAC)
On machine B (Windows)
"address": (A IP Address),"remoteRoot": "/Users/Sofian/src/tmp", "localRoot": "${workspaceRoot}"
Actual: I am attaching correctly, I am able to debug but that only works for .js not the .ts files.
Expected: I should be able to debug in my ts source.
Advanced scenario
this is even cooler.
On machine A (MAC)
"inlineSources": true
.On machine B (Windows)
Actual: the debugger connects the sources are streamed, even without having them in the local machine. But when I change the debugger profile to allow sourcemaps, I can't get the debugger to stream the TS sources.
Expected: It will be super cool if actually the debugger can stream the TS sources. I was able to get it to do this locally by deleting the TS sources without deleting the sourcemaps, it did the right thing by opening a read only TS file. That can be very helpful for debugging live websites.
Either way, this is really cool :)
The text was updated successfully, but these errors were encountered: