Closed
Description
Can you reproduce the problem with latest npm?
Yes.
Description
One of my npm modules causes the production (npm run build
) builds to fail with an UglifyJs syntax error. However, I am able to run the app with npm start
without any errors or problems.
Expected behavior
Should be able to build production build if development build is working.
Actual behavior
When running npm run build
:
Creating an optimized production build...
Failed to compile.
static/js/main.455932b3.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/evolutionary/select1.js:5,0]
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): [email protected]node -v
: v6.9.0npm -v
: v3.10.9
Then, specify:
- Operating system: Mac OS X Sierra
- Browser and version: N/A
Reproducible Demo
- Generate a new project with create-react-app
- Run
npm install evolutionary
- Put
import 'evolutionary'
at the top ofindex.js
- Run
npm start
. Confirm that app loads in browser w/ no errors. - Run
npm run build
. Error appears
I've never used webpack, but from my experience with browserify I would assume that ES6 syntax in dependencies would be handled just as fine as my app code.
Metadata
Metadata
Assignees
Labels
No labels