Closed
Bug 1497927
Opened 6 years ago
Closed 6 years ago
Firefox does't use source maps for javascript modules loaded with import
Categories
(DevTools :: Console, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mail.eraserhead, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Steps to reproduce:
I have a Javascript file "cms_script.js" that imports javascript modules via import. One module is "CMS.js"
Each file has a source map.
I made an error in line 773 of CMS.js.
Actual results:
Firefox only uses the sourcemap of the "parent" javascript file "cms_script.js", but not of the imported module "CMS.js".
It shows the error in line 1:13818
Expected results:
the source map of the module "CMS.js" should be used.
The reported line should be 773.
I've attached a screenshot from Chrome (doing it correctly) and Firefox (doing it wrong).
Updated•6 years ago
|
Component: Untriaged → Debugger
Product: Firefox → DevTools
I'm sorry, looks like the problem only happens when the error occurs inside a try/catch construction - which is tricky to pinpoint.
I guess you can close this report.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Sorry again, I have to reopen this. As I said the source map is not used if the error happens inside a try/catch construction. But this is more annoying than I first thought. E.g. if inside try/catch a new class is instanced and an error happens inside that class Firefox also doesn't use the source map (while Chrome does).
So I guess you have to make sure the source map is always used when available.
Updated•6 years ago
|
Blocks: source-maps
Comment 3•6 years ago
|
||
Maybe a dup of bug#1471509.
Updated•6 years ago
|
Component: Debugger → Console
Comment 4•6 years ago
|
||
Could you try it again, we recently fixed an issue with sourcemaps in error stacks.
I'm afraid it's still not right. Please look at the new screenshot I uploaded.
- the error happens in CMS.sendPost() in line 392;
- CMS.sendPost() is called in a try/catch from cms_script.js
- the catch() is processed in CMS.modalError()
Firefox gives the correct lines for every called function except for the one where the error actually happens. There we only have the location in the compressed file.
If you compare to the Chrome output (I highlighted the important part) you'll see that Chrome got that line, too.
I checked with Firefox 63 and the latest Nightly.
Comment 7•6 years ago
|
||
oops, this fix hasn't landed yet
https://bugzilla.mozilla.org/show_bug.cgi?id=1500963
Comment 9•6 years ago
|
||
C.Martin, hello, could you try to reproduce the issue on the latest Firefox Nightly? Thanks!
Flags: needinfo?(mail.eraserhead)
Priority: -- → P1
Reporter | ||
Comment 10•6 years ago
|
||
Hello Nicolas, everything's fine in Nightly! Issue resolved.
Flags: needinfo?(mail.eraserhead)
Comment 11•6 years ago
|
||
🎉 Yay!
Thanks for checking :)
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago → 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•