Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Incompatible with create-react-app #12

Open
sulliwane opened this issue Nov 21, 2017 · 6 comments
Open

Incompatible with create-react-app #12

sulliwane opened this issue Nov 21, 2017 · 6 comments

Comments

@sulliwane
Copy link

Hello,
when building my creat-react-app, I get this error:

> react-scripts build
Creating an optimized production build...

Failed to compile.

Failed to minify the code from this file: 
 	./node_modules/metamascara/mascara.js:7 

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

=> https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify

Any idea?

Many thanks

@sulliwane
Copy link
Author

=> http://bit.ly/2tRViJ9

Some third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.

It would be nice to publish a ES5 compiled version of metamascara...

@sulliwane
Copy link
Author

For anyone experiencing the same problem as me, I forked mascara (and all its non es5 valid deps), compiled to ES5 and published to npm. You can install ES5 version by simply:

npm i metamascara-es5

the repo is here.

@frankiebee
Copy link
Contributor

Hey sorry I have been away the past week with bad wifi and holiday did not see this issue get opened. Will publish as es5 in the next release next week.

@sulliwane
Copy link
Author

Would be super cool, thanks

@sulliwane
Copy link
Author

Hello there, any progress on this issue?

@Gudahtt
Copy link
Member

Gudahtt commented Aug 14, 2019

Using exclusively ES5 libraries is no longer recommended by create-react-app, as of v2 I believe. They transpile their dependencies now instead.

As of Babel 7 compiling libraries to ES5 is no longer necessary to support applications that target ES5, because transpiling dependencies is now much easier than it was with Babel 6. See this blog post for more details.

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

No branches or pull requests

3 participants