my issue is that I've tried to create a new react project and after a lot of issues with vulnerabilities I managed to solve some of them, one of the main instructions was adding this line:
"overrides": {
"@svgr/webpack": "$@svgr/webpack"
},
into my package.json file.
Once I've done that I had to delete my node_modules folder and reuse npm install
and now I am getting a babel error after typing npm start
.
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
I tried to search for the solution over the internet and I found only one that tells me to add this plugin to my devDependencies which did not work, and I also found a solution that tells to type CI= npm run build
which didn't work either.
This is what I'm encountering when typing npm list @babel/plugin-proposal-private-property-in-object
:
npm ERR! code ELSPROBLEMS
npm ERR! invalid: @babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2 C:\Users\Omri-PC\Desktop\KeeperApp\node_modules\@babel\plugin-proposal-private-property-in-object
keeper-app-part-1-starting@1.0.0 C:\Users\Omri-PC\Desktop\KeeperApp
├── @babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2 invalid: "^x.x.x" from the root project
└─┬ @svgr/webpack@8.0.1 overridden
└─┬ @babel/preset-env@7.22.5
└── @babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2 deduped invalid: "^x.x.x" from the root project
And that's how my package.json file looks like if it somehow helps to figure:
{
"name": "keeper-app-part-1-starting",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "src/index.js",
"dependencies": {
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@svgr/webpack": "^8.0.1",
"react-scripts": "5.0.1",
"typescript": "5.1.3"
},
"overrides": {
"@svgr/webpack": "$@svgr/webpack"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Hope that I gave you enough information in order to help me solve this issue, thanks a lot!