When i try to deploy my ReactJS on Heroku, i have the error:
PS: I create my ReactJS using CRA (Create-React-App)
ERROR Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: [BABEL] /app/src/index.js: Cannot find module '@babel/plugin-proposal-private-property-in-object
My package.json:
{
"name": "portfolio-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"lucide-react": "^0.257.0",
"prettier": "^2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-router-dom": "^6.14.1",
"react-router-hash-link": "^2.4.3",
"react-scripts": "5.0.1",
"sass": "^1.63.6",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/core": "^7.22.6",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-runtime": "^7.22.6",
"@babel/preset-env": "^7.22.6",
"@babel/preset-react": "^7.22.5",
"customize-cra": "^1.0.0",
"node-sass": "^7.0.3",
"react-app-rewired": "^2.2.1"
}
}
I try solve the problem creating a many files: config-overrides.js .env .babelrc