andreypopp / autobind-decorator

Decorator to automatically bind methods to class instances
MIT License
1.45k stars 66 forks source link

v2.2 breaks create-react-app v1 #72

Closed nmitha closed 5 years ago

nmitha commented 5 years ago

The changes made in v2.2 cause the following error running npm run build with a react-scripts 1.1 (aka "Create React App"):

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

        ./node_modules/autobind-decorator/src/index.js:7

The above issue went away after downgrading autobind-decorator to 2.1.0.

I'm mostly just posting this here as an FYI in case someone else runs into this...

vovchik33 commented 5 years ago

Also we get the same problem with code minimizing through UglifyJSPlugin in Webpack.

stevemao commented 5 years ago

https://github.com/andreypopp/autobind-decorator/issues/69#issuecomment-435626439

stevemao commented 5 years ago

Please read https://babeljs.io/blog/2018/06/26/on-consuming-and-publishing-es2015+-packages