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

Add sourceMapPathOverrides #140

Closed
NatoBoram opened this issue Oct 16, 2019 · 6 comments
Closed

Add sourceMapPathOverrides #140

NatoBoram opened this issue Oct 16, 2019 · 6 comments

Comments

@NatoBoram
Copy link

NatoBoram commented Oct 16, 2019

There's a great starting point for debugging Angular apps at vscode-recipes/Angular-CLI, but it uses the sourceMapPathOverrides key, which doesn't seem to be supported by Debugger for Firefox. Workarounds would be to add a configuration for Firefox in vscode-recipes/Angular-CLI or to add a snippet for Firefox to Angular Snippets, but it would be nice if Debugger for Firefox could reach feature parity with Debugger for Chrome.

@hbenl
Copy link
Collaborator

hbenl commented Oct 16, 2019

The equivalent to sourceMapPathOverrides is pathMappings. The syntax is different - instead of "something/*": "something-else/*" you have to write {"url": "something", "path": "something-else"}. Also, I'm not sure if these are necessary at all - the debug adapter uses some default pathMappings that should work with most webpack setups. I will investigate this soon and report back here.

@NatoBoram
Copy link
Author

Is there a way to automatically parse sourceMapPathOverrides and convert it to pathMappings? That would be a nice way to add seamless support for Debugger for Firefox from an existing Debugger for Chrome configuration.

@hbenl
Copy link
Collaborator

hbenl commented Oct 16, 2019

That should be possible, just remove any trailing * from the sourceMapPathOverrides and convert the way that it is written (i.e. turn { "u1": "p1", "u2": "p2" } into [{ "url": "u1", "path: "p1" },{ "url": "u2", "path": "p2" }]).

@digitarald
Copy link
Contributor

@hbenl should we make it a feature request to allow the same property and syntax?

@hbenl
Copy link
Collaborator

hbenl commented Oct 18, 2019

@NatoBoram I just created an Angular app with Angular CLI version 6 and I could debug it without any pathMappings. So don't try to convert the sourceMapPathOverrides from that recipe - I tried that and then breakpoints stopped working.

@digitarald I'm not very fond of that idea - we'd have to ensure that the path mapping code works exactly the same as the one in the Chrome adapter, otherwise any difference will be perceived as a bug in the Firefox adapter (which would only be fair if we create the expectation that it works the same). In my experience, manual path mappings are very error-prone and I've seen several examples where people break the debugger by adding manual path mappings when it would have worked fine without them, so I don't want to encourage people to blindly add even more manual path mappings.

@hbenl
Copy link
Collaborator

hbenl commented Dec 14, 2019

I have added the Path Mapping Wizard, which I think is much better for dealing with path mapping issues than trying to support sourceMapPathOverrides.

@hbenl hbenl closed this as completed Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants