ERROR from UglifyJS on build:production

Copping this error when I go to deploy/build for production.

I believe it’s an underlying problem with Webpack and Uglify, but just wondering if somebody here has faced a similar issue as I’ve spent many hours on SO and other forums and yet to find a solution.

Unexpected token: operator (>) [scripts/main_08ee6cfa.js:40288,22]

1 Like

Removing the excludes from the jsx loader in WebPack seems to be working.

        test: /\.jsx?$/,
        // exclude: [/(node_modules|bower_components)(?![/|\\](bootstrap|foundation-sites))/],
        loader: 'babel',
1 Like

Any vendor library you install via npm/yarn doesn’t get transpiled through babel.
You can either force that when importing that library by prepending the babel loader such as import 'babel!library-name' or change the exclude condition in the webpack.config like you did, but it’s not an error in sage. It’s just telling you you’re import an ES5+ library.