Failed to minify / pkg command fails
Coolranch opened this issue · 3 comments
I'm currently trying to use your library, which is fantastic by the way, and it works fine during development, but when I attempt to build I get the error:
Failed to minify the code from this file:
./node_modules/slack/src/_bind.js:10
Any help resolving this error would be great. Here are the details of my application:
"react": "^16.3.2"
"slack": "^11.0.0"
Let me know if you need any more info.
** UPDATE: installed the alpha version of react-scripts@2
and my build is no longer failing
I am experiencing similar issues with my build.
$ react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/slack/index.js:1
Read more here: http://bit.ly/2tRViJ9
Per create-react-app
instructions:
To resolve this:
Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled.
Note: Create React App can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is CommonJS. However, they can optionally provide an ES module entry point with the module field in package.json. Note that even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers.
Fork the package and publish a corrected version yourself.
If the dependency is small enough, copy it to your src/ folder and treat it as application code.
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.
Thanks! I upgraded to the alpha and it fixed my issue.