Closed Bug 1553374 Opened 5 years ago Closed 4 years ago

Source map issues with Google Closure compile

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

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

Flags: needinfo?(hkirschner)

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.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(hkirschner)
Resolution: --- → INVALID
Resolution: INVALID → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.