Vashnak / react-toasts

Simple react alerter
56 stars 19 forks source link

use with create-react-app getting 'Failed to minify the code from this file' #1

Closed zz-james closed 7 years ago

zz-james commented 7 years ago

using react-toasts with create-react-app is giving the error: 'Failed to minify the code from this file' when I try to run the production build script.

Create-React-App's authors recommend that: "To resolve this:

Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled (retaining ES6 Modules)."

Any help would be appreciated. Many Thanks

James

Vashnak commented 7 years ago

Okay, I'm on it

zz-james commented 7 years ago

Ah, many many thanks. No stress I hope 👍

Vashnak commented 7 years ago

Can you show me how you import the module ? I don't have your bug with create-react-app

zz-james commented 7 years ago

ok I just installed it with npm install -s so it's in my project's node modules folder. then imported it with

import {ToastContainer, ToastStore} from 'react-toasts';

I'm using create-react-app 5.4.2

for the time being I just put index.js, the stylesheets and _BaseStore into the src directory and changed a few lines to make it use ES6 style classes, and that seems to have done the trick for me and the build runs.

Just incase it's important: -> The was no error with npm start, only with npm run build.

the error message was:

Failed to minify the code from this file:

./node_modules/react-toasts/index.js:17

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

Thanks for your work by the way! it is working really well and was the perfect lightweight zero-config solution I was looking for.

Vashnak commented 7 years ago

Okay, I reproduced bug, I will fix it

Vashnak commented 7 years ago

Hi James, it should be okay now with the version 1.2.3, can you try it and say me ?

zz-james commented 7 years ago

ok sorry for delay, am trying it now.

zz-james commented 7 years ago

Yes it works a dream now. Thank You for your work.