26

I have created a concatenated, minified file through the Node.js wrapper for Google Closure Compiler. When I open the Developer Tools in Google Chrome, both the source map and the mapped files all load appropriately.

A problem I'm having is that breakpoints aren't triggering in the source map files like they would running an unminified, separate-file session. Sometimes I'll try to place a breakpoint in a script and it will jump several lines down rather than where I'm trying to set it. But what is most frustrating is that when I can set a breakpoint, they aren't triggered! I'll set one in the middle of a function that I know is being called, but the script never pauses execution.

EDIT

I'm running Chrome 31.0.1650.57 on Ubuntu 13.10. I can't get it to work in Firefox 25.0 either.

Ian Hunter
  • 9,466
  • 12
  • 61
  • 77

1 Answers1

5

From what I can gather, the breakpoints jump due to the closure compiler combining statements and Chrome only supporting whole statements as breakpoints.

PixnBits
  • 1,150
  • 10
  • 14
  • By "combining statements" do you mean removing newlines? – Ian Hunter Dec 09 '13 at 22:44
  • That and more, notice the output from [compiling the default](http://closure-compiler.appspot.com/home) adapted: ` function hello(name) { if(name){ alert('Hello, ' + name); }else{ alert('Shy?'); } } hello('New user'); ` – PixnBits Dec 11 '13 at 21:04
  • 1
    Surprisingly, minified sources don't have the best support in Chrome: https://code.google.com/p/chromium/issues/detail?id=327092 – PixnBits May 19 '15 at 15:40