Source map issues with Google Closure compile
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: Harald, Unassigned)
References
(Blocks 1 open bug)
Details
Via https://hacks.mozilla.org/2019/05/faster-smarter-javascript-debugging-in-firefox/#comment-24847
Example : https://github.com/dascritch/cpu-audio/blob/master/dist/cpu-audio.js with https://github.com/dascritch/cpu-audio/blob/master/dist/cpu-audio.js.map
Level = SIMPLE
–isolation_mode=IIFE
with a multiline commented prologue (see make.sh)
I tried reproducing the cpu-audio
issue here: https://firefox-devtools-test-closure-compiler.glitch.me/
- I had to
make.sh
script for the project, which didn't actually output the source map declaration for the JS file. - When appending the
//#
declaration to the output, the source mapping is off: https://sourcemaps.io/report/1559941085191_https%3A%2F%2Ffirefox-devtools-test-closure-compiler.glitch.me%2Fcpu-audio.js - Source map doesn't work for both Chrome and Firefox
- When outputting the JS without the
//#
appendix and loading the source map file manually (right-click in editor "Load source map"), the mapping seems correct
Not sure what I am doing wrong to output a working source map in closurescript
Maybe cpu-audio has other issues elsewhere. So as a simpler example, I added hello.js
, which is compiled via java -jar closure-compiler.jar --js hello.js --js_output_file hello-compiled.js --compilation_level SIMPLE_OPTIMIZATIONS --output_wrapper "{%output%}//# sourceMappingURL=hello.map.js" --create_source_map hello.map.js
and it also doesn't work: https://sourcemaps.io/report/1559941962448_https%3A%2F%2Ffirefox-devtools-test-closure-compiler.glitch.me%2Fhello-compiled.js
Comment 1•5 years ago
|
||
Harald, could you try and get this setup and share the result on glitch?
Reporter | ||
Comment 2•5 years ago
|
||
I pinged the comment and will wait a bit for the author to have a chance to comment here.
Comment 3•5 years ago
|
||
I wonder what is buggy about it, the source tree, breakpoint locations?
Comment 4•5 years ago
|
||
The priority flag is not set for this bug.
:jlast, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 5•5 years ago
|
||
Harald, what do you want to do here? Would you like to try and bring the example to glitch and document the issues or should we close it?
Reporter | ||
Comment 6•5 years ago
|
||
Added 2 hours of investigations to the first comment 🙇🏼♂️
Comment 7•5 years ago
|
||
The priority flag is not set for this bug.
:jlast, could you have a look please?
For more information, please visit auto_nag documentation.
Reporter | ||
Updated•5 years ago
|
Comment 8•4 years ago
|
||
You say on step 3 that the map doesn't work for Chrome or Firefox, but you didn't specify what specifically "didn't work". Is there some specific part of the file that you looked at where the mappings didn't seem right?
Both examples have issues with some of the name
mappings being wrong, but that seems like a closure-compiler bug rather than a Firefox bug.
I'm not sure what the next steps here are, there doesn't seem to be anything that indicates there is a problem with Firefox itself.
Reporter | ||
Comment 9•4 years ago
|
||
I can't recall anymore what my analysis yielded. If the maps are wrong itself, then this bug has nothing actionable.
If others find STR for broken Closure Compiler source maps, please re-open.
Reporter | ||
Updated•4 years ago
|
Description
•