-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Typescript breakpoints no longer work since 1.25 #54026
Comments
(Experimental duplicate detection) |
Well, it may not be connected to VSCode itself (but e.g. a Node debug adapter component) but something that has been working so far did break on a certain VSCode version update. |
I made a simple test case which works in 1.24 but doesn't work in 1.25. Instructions:
|
@gombosg does your test case work in the latest Insiders? |
@weinand Nope. 1.25 and 1.26 Insiders seem to be affected. |
Apparently with the mapRoot and sourceRoot tsconfig options, tsc writes out absolute local paths for sourceMappingURL and sourceRoot. I think this is wrong, they should be file URIs and are usually relative paths. I just "fixed" this last month so that / urls can be resolved from the root of a webserver. Since tsc is doing this, I'll have to support this format too. This might be too late for 1.25.1 though. |
In my defense, Chrome devtools doesn't handle windows-style local paths which is what TS outputs on Windows, so I will file a bug on Typescript. It does on MacOS though. |
I filed microsoft/TypeScript#25587 |
@roblourens Thanks a lot! Also, tsc can be configured from gulp etc. and absolute paths can be set anytime. I actually set absolutes source map paths in the gulp config file because it didn't work other way, it was trial and error. |
FYI as a quick fix I set the source map URLs in Gulp to relative by setting a relative |
I am also having the same issue. I was working on two typescript projects with different code-bases that have been working with breakpoints for at least the past year and both of them stopped working with the update. :( I am not using gulp and don't plan to implement it for this issue. Any idea when this might be fixed so I can plan accordingly? (Or at least provide some workaround config I can use in my tsconfig)? |
It appears that if I remove Here are my configs in case others experience issues to aid in possible troubleshooting. Before
After
|
This will be fixed in TS' end in TS 3.0, but I'm trying to get a workaround out on our end in Insiders. |
I think the issue I was experiencing was actually from issue #53785 and might be unrelated from what was reported in this ticket (unless this is a duplicate) |
@paustint Since you said it's related to mapRoot, this is probably the right issue. |
Please try this workaround for mac/linux. Add this to your launch config: "pathMapping": {
"/": "/"
} You will get an warning that the property is "not allowed", ignore it. |
@gombosg Life saver! changed path to relative in gulp and I have my breakpoints again. Thank you! |
Also having this problem - adding |
Never mind my comment above. This is actually a Jest problem for me. Unfortunately both vscode and Jest seem to have problems related to debugging in recent releases. For me, the latest release of vscode works with jest@22 + ts-jest but not jest@23. |
There will be a fix in tomorrow's insiders build, please try it out. |
I wasn't able to break with: tsconfig.json:
but was after removing the mapRoot and sourceRoot entries. |
That is probably producing paths that are not correct. Also, what TS version? It's different after 3. |
3.0.1 |
Yeah with those options you get |
Verified for TS@<3.0 |
Steps to Reproduce:
launch.json
or attach to a process started from the terminal..ts
files.Does this issue occur when all extensions are disabled?:
Yes, it's occurring with a vanilla Insiders Edition, too.
Our Typescript directory structure is the following:
src/...
- Typescript source filesbuild/...
- Built Javascript filesbuild/src/...
- Source mapsE.g.
src/app.ts
is the main source file,build/app.js
is the Javascript,build/src/app.js.map
is the source map.The Javascript files point to the source maps at their end with a relative path e.g.
//# sourceMappingURL=../src/server/app.js.map`.
The source maps are built with gulp and they point to the exact absolute source path at their end e.g.
outFiles
is properly set inlaunch.json
, but simply attaching to a running process worked, too.This used to work perfectly, breakpoints always worked, but they appear as 'unverified' (greyed and hollow) since 1.25. Downgrading back to 1.24.1 helped though.
Let me know if you need some special logs.
The text was updated successfully, but these errors were encountered: