react-preload icon indicating copy to clipboard operation
react-preload copied to clipboard

Failed to minify ImageHelper.js

Open Bradley-Morris opened this issue 6 years ago • 4 comments

I'm using the Preload package in my app , I use webpack to bundle and minify everything using the HtmlWebpackPlugin with minifyjs set to true. When I build the project with this package installed I get the following error:

Failed to minify the code from this file:

    ./node_modules/react-preload/lib/ImageHelper.js:3

Any hints as to how I could solve this?

It appears that it isn't transpiled to ES5. According to the following link:

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

I'll try create a transpiled version.

Bradley-Morris avatar Aug 27 '18 09:08 Bradley-Morris

Just got back from being off the grid for 10 days!

I'll take a look- do you have a sample minimal test case I could use to reproduce this? My gut tells me that I'm probably transpiling down to es6 instead of es5.

sambernard avatar Sep 05 '18 20:09 sambernard

+1 I am facing the same error on production build with create-react-app boilerplate. Can you suggest any solution. Youur lib is good shot but anyway i am facing this issue.

kechstart avatar Oct 19 '18 18:10 kechstart

@kechstart can you put together a test case so I can reproduce?

sambernard avatar Oct 19 '18 22:10 sambernard

@kechstart @sambernard I had this issue on CRA. But I updated my react-scripts to 2.0 or higher and it solved the problem.

josephmallari avatar Nov 01 '18 14:11 josephmallari