Open Bug 1553374 Opened 7 months ago Updated 6 months ago

Source map issues with Google Closure compile

Categories

(DevTools :: Debugger, defect, P3)

defect

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/

  1. I had to make.sh script for the project, which didn't actually output the source map declaration for the JS file.
  2. 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
  3. Source map doesn't work for both Chrome and Firefox
  4. 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

Harald, could you try and get this setup and share the result on glitch?

Flags: needinfo?(hkirschner)

I pinged the comment and will wait a bit for the author to have a chance to comment here.

Flags: needinfo?(hkirschner)

I wonder what is buggy about it, the source tree, breakpoint locations?

The priority flag is not set for this bug.
:jlast, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jlaster)

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?

Flags: needinfo?(jlaster) → needinfo?(hkirschner)

Added 2 hours of investigations to the first comment 🙇🏼‍♂️

Flags: needinfo?(hkirschner)

The priority flag is not set for this bug.
:jlast, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jlaster)
Flags: needinfo?(jlaster)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.