Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-scripts build: Failed to minify the code from this file #34

Closed
shurik239 opened this issue Jun 11, 2018 · 3 comments · Fixed by #40
Closed

react-scripts build: Failed to minify the code from this file #34

shurik239 opened this issue Jun 11, 2018 · 3 comments · Fixed by #40

Comments

@shurik239
Copy link

By trying to build react application it comes to error:

Failed to minify the code from this file: 

 	./node_modules/base64url/dist/base64url.js:4 

Read more here: http://bit.ly/2tRViJ9

They suggest:

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.

base64url: 3.0.0
react-scripts: 1.1.4

@magician11
Copy link

magician11 commented Jun 28, 2018

It looks like the issue is this ES6 feature

function encode(input, encoding = "utf8") { (using a default value for a function parameter).

From the docs, it looks like this module needs to compile their code to ES5 and then published to npm.

@vongohren
Copy link

Can we get a discussion going on this one? Why would a lib that is so integral to many other libs not be compatible with minification?

MylesBorins added a commit to MylesBorins/base64url that referenced this issue Nov 26, 2018
Not used enough es6 features to really justify it.

This should fix a bunch of open issues

Fixes: brianloveswords#34
Fixes: brianloveswords#35
Fixes: brianloveswords#31
@MylesBorins
Copy link
Collaborator

We are going to target es5 instead of es6 which fixes this and a couple other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants