-
Notifications
You must be signed in to change notification settings - Fork 280
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
Apply pathMapping when loading sourcemaps #1240
Comments
The In your example, the sourcemap for app.ts is set to return a 404. This causes breakpoints not to bind; the debugger needs a sourcemap to work with. |
Thanks for the quick feedback. The reason why my example gives a 404, is to demonstrate, that the ...
"pathMapping": {
"/android_assets/www/": "${workspaceFolder}/build/"
}
... Even if we transfer the source map file to the device too, this extension will try to read the scheme "file:///android_assets/www/app.js.map" from "C:/android_assets/www/app.js.map". If path mapping would support source maps, the source map wouldn't need to be pushed to the device at all, and would just be loaded from the local file, right next to the file that was mapped for the source file. The way I understood path mapping, was that it is used to map files in the browser to files on the file system. I don't quite get why this shouldn't apply to source map files too. |
We had this feature request before, though I cannot seem to find the issue for it, so I will reopen this. PR's welcome. Code pointers:
|
Great, I will try to provide a PR tomorrow |
This doesn't seem to work for me. I still get the message about the source map not loading:
Maybe the fix doesn't work on windows? |
@rchiodo can you confirm that you're on the nightly build of js-debug? https://github.com/microsoft/vscode-js-debug#nightly-extension |
Reran this using the latest nightly release in my original reproduction repo. Worked as expected.
I developed this feature on windows, so I can verify this definitely works there too. |
Closing to attempt to reverify. There's also a stable version published. |
Yeah I'm on the latest I think:
I do have a bunch of errors/messages for the vscode.js-debug though?
|
And I'm still getting the problem. Breakpoint doesn't bind. |
@rchiodo The error messages you are getting show, that the nightly build fails to take effect, because the builtin version of the extension is still enabled. As described in the instructions linked above by @connor4312 , you need to disable the builtin extension, before installing the nightly build. The builtin extension can be found by searching for |
That explains it. Didn't realize I had to disable something. Verified breakpoint is hit for me. |
Describe the bug
pathMapping
andoutFiles
provide the ability to use local files for debugging and not transferring them using network protocols. However,pathMapping
is not applied to the path of a source map file.sourceMapPathsOverrides
does exist, but is used for files that are referenced by source maps. This results in the following issues.To Reproduce
Steps to reproduce the behavior:
npm ci
to install dependenciesnode serve
to start a simple HTTP-Server, which serves the index.html, the app.js but not the source mapLaunch
launch configuration, to compile and launch chrome.Debug: Diagnose Breakpoint Problems
and select "What scripts and sourcemaps are loaded"Log File
Full logfile will be send via e-mail.
VS Code Version: 1.66.2
Additional context
Fixing this should be fairly straightforward. Within sources.ts in addSource, the source map url needs to be converted like the url of the source file. If that proposal is accepted, I would like to provide a pull-request.
The text was updated successfully, but these errors were encountered: