Failing source maps should fall back to generated source
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: Honza, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
STR:
- Open github.com
- Enable Pause on any URL in XHR Breakpoints
- Click around until Debugger pauses
ER: Source maps fail, but it should just use the generated sources
AR: All files fail to load:
From: https://github.com/firefox-devtools/debugger/issues/8058
Honza
Reporter | ||
Updated•6 years ago
|
Comment 1•5 years ago
|
||
I think jumping back to the generated code in this context is totally fine, but I wanted to make one thing clear first.
A sourcemap can have multiple original sources, and only a subset of them could fail to load, which means that we won't want to invalidate the whole sourcemap in this case, just a specific original-source file. The other piece is that the stack trace sidebar shows original vs generated positions based on whether you are currently viewing a generated vs original file, so if we attempt to open an original-source file and it fails to load, and we show the generated source instead, we're not just changing the file you're viewing in the editor, we're also changing all of the stack trace entries in the sidebar to show generated positions, even though the positions themselves are probably accurate for the original file, and it's just the content of the file itself failed to load, and a user may well have the file locally in a text editor or something that they still could have looked at to compare the stack trace lines to.
Is this interaction between the editor and the sidebar stack trace positions something everyone is fine with?
Comment 2•5 years ago
|
||
A sourcemap can have multiple original sources, and only a subset of them could fail to load, which means that we won't want to invalidate the whole sourcemap in this case, just a specific original-source file.
Do we have some idea or evidence how common builds are with sources missing? Not shipping original sources seems very common for production sites, like in the case of github or reddit?
Is this interaction between the editor and the sidebar stack trace positions something everyone is fine with?
Given that this case has incomplete source maps, it seems like an acceptable trade-off. The original files can still be reached in the sources panel.
Reporter | ||
Comment 3•5 years ago
•
|
||
@Harald, this is originally reported by you, but I can't reproduce it using STR from comment #0, can you?
Edit: I was just able to reproduce this. Note that I had to be logged in.
Honza
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 4•5 years ago
|
||
Chrome is not much better
Comment 5•5 years ago
|
||
Comment 6•5 years ago
|
||
What Chrome does a bit better is making the reference to the generated file styled as a link so it's more obvious?
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Good Test case from Bug 1802515
STR
- Go to https://test-case-bug1802515.glitch.me/
- Open the debugger
- Select
myCurrency.js
- Set a breakpoint on line 4
- Reload the page
AR
Breakpoint get hit and pauses and jumps to myCurrency.ts
which throws an error
Error while fetching an original source: request failed with status 404 Source URL: <unknown>
ER
Breakpoint get hit and pauses but should stay on the generated file since myCurrency.ts
(the original file) is not found.
Description
•