I created a React application using npx create-react-app my_app
but when I run the application using npm start
I get the following error,
I tried to use npm install @babel/plugin-proposal-private-property-in-object
to install the package "@babel/plugin-proposal-private-property-in-object", but still encountered to the same error. how to solve this problem?
P粉0789451822023-11-04 10:20:22
This is what worked for mebabel packagecombination:
"devDependencies": { "@babel/core": "7.22.5", "@babel/eslint-parser": "7.22.5", "@babel/plugin-proposal-private-property-in-object": "7.21.11", "@babel/preset-env": "7.22.5", }
Important Steps
Add @babel/plugin-proposal-private-property-in-object
to .babelrc plugin.
Things like this:
"plugins": [ ["@babel/plugin-proposal-private-property-in-object", { "loose": true }] ]