Closed Bug 1345533 Opened 3 years ago Closed 2 years ago

show source-map failures to user

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(firefox57 fixed)

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

A reasonably common scenario is that a user has code with source maps
but the source maps don't work for some reason.  The devtools should
be able to explain what went wrong.

You can find all kinds of examples of this on stack overflow, e.g.
http://stackoverflow.com/questions/32703806/why-are-our-source-maps-broken-in-production
I agree this is very important for a good source map experience.  There are many ways things can fail, and currently failures are silent, so you have no way to diagnose the issue.
Priority: -- → P2
See https://bugzilla.mozilla.org/show_bug.cgi?id=1359144#c12 for one spot to possibly fix.
bug 1167188 looks like a good way to handle this. Showing (source map) network errors in the network panel seems like the best solution to me. 

We might also want something in the console as long as there are filter options for it people can hide the source map messages they don't want to see.  This bug could be for handling that in the console, but if they appear as regular network errors in the console I think that's fine as well.
Another idea I had was, in the console, showing some kind of icon next to a location ("mumble.js:73")
indicating that source map fetching was underway.  Then the icon could change to some sort of error
indicator if something went wrong.

This would at least show some of the reasons source maps can fail.
It wouldn't handle the case where the bundle was generated incorrectly and doesn't have the
magic comment at all; which I can imagine wishing to be informed of.
I like it.  Perhaps if there was an error you could click the icon and jump to the network panel?
Priority: P2 → P3
One additional to-do item here is to surface the error cases from devtools-source-map.
There's at least one spot where console.error is used, but also some spots where
invalid things are just dropped.
I talked with :bgrins about this a bit in SF.  Our conclusion was to notify the user via console logs.

Using the network monitor didn't seem that great; partly because it's difficult to implement (hard
to get all the HAR data for a client-side request), and partly because it seems like it would obscure
the messages.

I don't recall offhand why we dismissed the idea of some kind of icon in the frame component.
Assignee: nobody → ttromey
Duplicate of this bug: 1167188
See Also: → 1228496
Depends on: 1384943
Depends on: 1385032
Blocks: 1385337
Comment on attachment 8893546 [details]
Bug 1345533 - report source map errors to the web console;

https://reviewboard.mozilla.org/r/164618/#review170078

Nice, this just needs a rebase for toolbox.js

::: devtools/client/framework/toolbox.js:558
(Diff revision 1)
>            return (urlInfo) => {
> -            return target.getOriginalURLs(urlInfo).catch(console.error);
> +            return target.getOriginalURLs(urlInfo)
> +              .catch(text => {
> +                let message = L10N.getFormatStr("toolbox.sourceMapFailure",
> +                                                text, urlInfo.url, urlInfo.sourceMapURL);
> +                this._target.logErrorInPage(message, "source map");

Nit: there's a `target` getter so we don't need to use `._target`
Attachment #8893546 - Flags: review?(bgrinstead) → review+
Comment on attachment 8893545 [details]
Bug 1345533 - display newlines in some console messages;

https://reviewboard.mozilla.org/r/164616/#review170288

Look good to me, thanks Tom
Attachment #8893545 - Flags: review?(nchevobbe) → review+
Blocks: 1387477
Fixing the eslint trivia.
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c405b138c2b
display newlines in some console messages; r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/82c5a8086a64
report source map errors to the web console; r=bgrins
https://hg.mozilla.org/mozilla-central/rev/0c405b138c2b
https://hg.mozilla.org/mozilla-central/rev/82c5a8086a64
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.