reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Cannot create a production build #204

Closed nakulsolanki closed 6 years ago

nakulsolanki commented 6 years ago

I used create-react-app to create my application. When i try to create a production build using build command i get the following error: Creating an optimized production build... Failed to compile.

Failed to minify the code from this file:

    ./node_modules/react-chartjs/lib/core.js:8

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

DylanMunyard commented 6 years ago

Hi @austinpray, @benmccann, my change to replace createReactClass with ES6 class may only work in client-side libraries, in a server app created using create-react-app -> npm build run is showing the error reported by @nakulsolanki. Can you review my PR, https://github.com/reactjs/react-chartjs/pull/205.

I have reverted the change, and then used create-react-app instead as the fallback, suggested here, https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#migrating-from-reactcreateclass.

I used jscodeshift to upgrade the component jscodeshift -t react-codemod/transforms/class.js path/to/components following these instructions to install it, https://github.com/reactjs/react-codemod#explanation-of-the-new-es2015-class-transform-with-property-initializers

austinpray commented 6 years ago

released as 1.1.0