Build errors between v5.1.2 and v5.2.1 on node v6


#1

Hello!

I’m part of an app that through other NPM plugins brings in Acorn and this morning during builds it fails during minifying. Forcing the version back to v5.1.2 complies properly. I’m looking for some thoughts on what might have changed between the versions that would cause it to fail on node 6.

node version: 6.3.1
npm version: 3.10.3
guip version: 3.9.1
uglify-js version: 2.8.29

Error during build:

undefined:1625
    throw new JS_Parse_Error(message, filename, line, col, pos);
    ^
SyntaxError: Unexpected token: name (named)
    at JS_Parse_Error.Object.defineProperty.get (eval at <anonymous> (/var/lib/jenkins/jobs/--sanitized--/workspace/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:86:23)

We upgraded a QA machine to node v8 and it builds properly which seems to indicate there’s a compatibility issue between a feature not available in v6 vs v8 of the node engine.

Any input would be quite helpful. Thanks.


#2

The error seems to come from UglifyJS—if Acorn itself runs on Node 6 (which it probably does—our continuous integration tests with a wide range of versions, including 6), but UglifyJS can’t minify it there, wouldn’t the problem be with UglifyJS?