question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Uglify 3.0 results in errors

See original GitHub issue

I’m submitting a bug report

  • Library Version: 0.29.0

Please tell us about your environment:

  • Operating System: OSX 10.x|Linux (distro)|Windows [7|8|8.1|10]

  • Node Version: 6.2.0

  • NPM Version: 3.8.9
  • Browser: all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView

  • Language: all | TypeScript X.X | ESNext

Current behavior: When uglify-js@3.0.0 is used, production builds fail:

image

Digging a bit further yields the follow error:

{ error: 
   { DefaultsError: `fromString` is not a supported option
       at DefaultsError.get (eval at <anonymous> (/Users/romainlanz/workspace/fivb/app.fivb.org/node_modules/uglify-js/tools/node.js:21:1), <anonymous>:86:23)
       at formatError (util.js:640:15)
       at formatValue (util.js:544:18)
       at formatProperty (util.js:798:15)
       at util.js:646:12
       at Array.map (native)
       at formatObject (util.js:645:15)
       at formatValue (util.js:585:16)
       at inspect (util.js:200:10)
       at exports.format (util.js:66:24)
     message: '`fromString` is not a supported option',
     defs: 
      { compress: {},
        ie8: false,
        keep_fnames: false,
        mangle: {},
        output: {},
        parse: {},
        sourceMap: false,
        timings: false,
        toplevel: false,
        warnings: false,
        wrap: false } } }

This is because Uglify-js@3 has a new API that is not backwards compatible with uglify-js@2:

image

Expected/desired behavior:

  • What is the expected behavior? aurelia-cli to work with uglify-js@3

  • What is the motivation / use case for changing the behavior?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sam-pipercommented, Jun 16, 2017

We just tried upgrading to uglify-js@3.0.15 - au build --env prod still fails, but there are no errors, instead the app-bundle.js / vendor-bundle.js files just contain the text “undefined”.

Will wait for an update to aurelia-cli here.

0reactions
JeroenVinkecommented, Jun 21, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Catching and handling Uglify errors when using Gulp
According to the Uglify documentation, gulp-uglify emits an 'error' event if it is unable to minify a specific file. Wherever possible, the ...
Read more >
uglify-js - npm
Start using uglify-js in your project by running `npm i uglify-js`. ... var result = UglifyJS.minify(code); console.log(result.error); ...
Read more >
gulp-uglify-chylvina - npm Package Health Analysis - Snyk
gulp-uglify emits an 'error' event if it is unable to minify a specific file. The GulpUglifyError constructor is exported by this plugin for ......
Read more >
Gulp-uglify NPM - npm.io
gulp-uglify emits an 'error' event if it is unable to minify a specific file. The GulpUglifyError constructor is exported by this plugin for...
Read more >
demo/node_modules/uglifyjs-webpack-plugin ... - GitLab
uglify -es is API/CLI compatible with uglify-js@3 . uglify-es is not backwards ... var result = UglifyJS.minify(code); console.log(result.error); // runtime ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found