Closed ivorpad closed 6 years ago
Hey @ivorpad, thanks for the bug report. Can you please make a repo I can clone that produces the error? Or post specific steps to reproduce it, including the version of CRA you're using. Thanks!
Hey @lourd,
Sorry I was short of time when I reported it.
Here it is: https://github.com/ivorpad/react-google-sheets-bug-report
Steps to reproduce:
yarn add @lourd/react-google-sheet
import { GoogleSheet, GoogleSheetsApi } from '@lourd/react-google-sheet'
yarn eject
yarn build
→ Failed to compile.
Hi @ivorpad, sorry for the long delay in replying.
The root issue is that this module is being published with ES6 syntax and the version of Uglify that the current version of create-react-app
is indirectly depending on cannot parse ES6.
There are 3 possible solutions I can think of:
react-scripts@next
, which is using webpack v4, which depends on the latest version of uglifyjs-webpack-plugin
, which depends on a version of uglify-js that can parse ES6.The steps to using the v2 beta version of create-react-app
are:
create-react-app foo
cd foo
yarn add react-scripts@next
I found that even if you've installed create-react-app@next
, you still have to manually upgrade react-scripts
after generating the project.
Hope solution 2 or 3 suffices!
@lourd I moved to my own solution but thanks a lot for taking the time to reply. I'll keep your solutions in mind for the next project.
I'm trying to include this module in a create-react-app app but I'm unable to do so.