Debugging failures in uglifyjs?

I can reproduce that in a standalone project, so it’s not just you.

Tracking up through the failing call stack, if I put

console.log("ch: " + ch.charCodeAt(0));

at the end of next_token, before it calls parse_error, in:

slider-test/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js

it’s character 65279 that’s blowing up the parser. That feels like the 0xFE 0xFF BOM; searching for that, it appears in vendor.js at:

; // Ion.RangeSlider

(except that the space between ; and // is actually this character). I fixed this in Webstorm by opening slider-test/bower_components/ionrangeslider/js/ion.rangeSlider.js and doing “remove BOM” – depending on what text editor you’re using you may need to do this differently.

Once I’d removed the BOM from that file (and removed dist/ and tmp/), ember build --environment=production works for me.