mascara icon indicating copy to clipboard operation
mascara copied to clipboard

Incompatible with create-react-app

Open sulliwane opened this issue 7 years ago • 6 comments

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 avatar Nov 21 '17 11:11 sulliwane

=> 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 avatar Nov 22 '17 14:11 sulliwane

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.

sulliwane avatar Nov 27 '17 10:11 sulliwane

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.

frankiebee avatar Nov 29 '17 18:11 frankiebee

Would be super cool, thanks

sulliwane avatar Dec 12 '17 14:12 sulliwane

Hello there, any progress on this issue?

sulliwane avatar Apr 16 '18 12:04 sulliwane

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.

Gudahtt avatar Aug 14 '19 14:08 Gudahtt