Closed Bug 1345533 Opened 7 years ago Closed 7 years ago

show source-map failures to user


(DevTools :: General, defect, P3)



(firefox57 fixed)

Firefox 57
Tracking Status
firefox57 --- fixed


(Reporter: tromey, Assigned: tromey)


(Blocks 1 open bug)



(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.
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 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
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;

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;

Look good to me, thanks Tom
Attachment #8893545 - Flags: review?(nchevobbe) → review+
Blocks: 1387477
Fixing the eslint trivia.
Pushed by
display newlines in some console messages; r=nchevobbe
report source map errors to the web console; r=bgrins
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.