I’m trying to debug my JS code, but for some reason, when I add ‘debugger’ command into the code, it doesn’t work on none of the browsers I tested(Chrome and Firefox).
I’m working on boundless theme. I added an alert() just above the debugger to be sure if the code is executed. So my code is like this:
The alert windows pops up. So I’m sure the code runs but debugger doesn’t stop at that point. When I checked the JS code of the currently running website, I noticed that the alert() which I had added is there but debugger is not there. Does Shopify remove the debugger command from the JS file? Or is there another problem? Help would be appreciated. Thanks.
I’m trying to debug my JS code, but for some reason, when I add ‘debugger’ command into the code, it doesn’t work on none of the browsers I tested(Chrome and Firefox)
Is there a way to disable that change for non live themes?
I am wondering Shopify applied that for all themes. I expected that non live themes will be excluded from this minification as the live caching behavior is different between live theme/preview theme (using shopifypreview.com/preview link sharing mechanism) and previewing a theme (using the preview_theme_id parameter).
Is there another workaround to use the debugger statement?
Hey, guys it happened also to me yesterday, so it is real. The minification now removes
debugger;
lines, but only from pure JS files. Inline JS in liquid files is not minified.
In my case I am just using this trick now. I am defining a public function in theme.liquid and then I call it in the .js files when I need that. This will work.