Open Bug 1603421 Opened 6 years ago Updated 3 years ago

Failing source maps should fall back to generated source

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: Honza, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Attached image image.png

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

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?

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.

See Also: → 1620408

@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

Flags: needinfo?(hkirschner)
Flags: needinfo?(hkirschner)
Attached image image.png

Chrome is not much better

What Chrome does a bit better is making the reference to the generated file styled as a link so it's more obvious?

Severity: normal → S3
See Also: → 1802515

Good Test case from Bug 1802515

STR

  1. Go to https://test-case-bug1802515.glitch.me/
  2. Open the debugger
  3. Select myCurrency.js
  4. Set a breakpoint on line 4
  5. 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.

Duplicate of this bug: 1802515
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: