-
Notifications
You must be signed in to change notification settings - Fork 369
Issue on a clean create-react-app and npm install @polkadot/api #4181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields - it is a valid JS construct. You will need to tell Babel to treat it correctly, it has a language plugin, see https://babeljs.io/docs/en/babel-plugin-proposal-private-methods |
I'm trying to override the Babel config of create-react-app with the customize-cra plugin. I'm struggling but I should get there. Wouldn't it be good for the Polkadot dev community that this works out of the box for starting developers? |
Sure, PRs welcome to scratch your itch. As you can imagine, I cannot track all build tools and their inability to understand modern JS. A lot of these are just severely lacking in trying to track the world. So while I try to cater for at least the basics, it is a never-ending battle. So, if it is an issue for you, then make a PR to address. |
I understand. React is one of the most used ones though. I'll attempt to make a PR. |
See for instance facebook/create-react-app#11339 where complaints are made around the exact same thing (browsers has support, CRA does not). The is really purely a CRA issue, nothing to do with the API, it tracks what browsers can and do support with babel/preset-env. (According to the linked issue it is solved in CRA 5.0 which is in alpha atm) |
Fair enough! Consider this issue closed. ;) |
Vue has this error as well. |
Closing. Against better judgement have adjusted the build process slightly in util 7.8.2 & api 6.7.1 - this should not appear in recent vereions. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Hi,
After doing a clean
create-react-app
andnpm install @polkadot/api
, I get below error onnpm start
.Am I missing a certain dependency for this repo to work out of the box?
The text was updated successfully, but these errors were encountered: