npm run build fails to minify
See original GitHub issueI’m in a situation where a package (base64url), multiple levels deep in my dependency hierarchy, has not compiled their npm code to ES5.
The output looks like
> taiga-app@0.1.0 build /Users/andrewgolightly/work/taiga/events-app
> react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/base64url/dist/base64url.js:4
Read more here: http://bit.ly/2tRViJ9
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! taiga-app@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the taiga-app@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Specifically the dependency chain of packages in my app looks like:
taiga-app@0.1.0 <- uport-connect@0.7.3 <- uport@0.6.2 <- jsontokens@0.7.8 <- base64url@3.0.0
I’ve added an issue to base64url, and no response yet. If I fork the package, and correct it, I’ll need to get all the above packages to update it seems? I don’t really see how I’d just add an updated version to my src directory since my code doesn’t directly depend on the base64url package.
In the docs for create-react-app
In the future, we might start automatically compiling incompatible third-party modules, but it is not currently supported. This approach would also slow down the production builds.
This would actually be super useful in my case here.
Otherwise next steps would be to eject and/or learn how to bundle my app with webpack or gulp?
What’s the best approach here to get this project built so I can deploy it? Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
Thank you @gaearon
From your suggestions, I got it working by updating the react-scripts version in my package.json file
"react-scripts": "2.0.0-next.3e165448",
then running
npm install
npm run build
then worked 👍You can use Yarn “resolutions” feature to override any nested dependency.
You can try 2.x alphas here, but note they’re less stable than 1.x. https://github.com/facebook/create-react-app/issues/3815