I’m trying to deploy a mern stack app on Heroku. When building, it fails with this:
Syntax error: [BABEL] /tmp/build_04904452/client/src/index.js: Cannot find module ‘@babel/plugin-proposal-private-property-in-object’ (0:undefined)
Require stack:
– /tmp/build_04904452/client/node_modules/babel-preset-react-app/create.js
– /tmp/build_04904452/client/node_modules/babel-preset-react-app/index.js
– /tmp/build_04904452/client/node_modules/@babel/core/lib/config/files/module-types.js
– /tmp/build_04904452/client/node_modules/@babel/core/lib/config/files/configuration.js
– /tmp/build_04904452/client/node_modules/@babel/core/lib/config/files/index.js
– /tmp/build_04904452/client/node_modules/@babel/core/lib/index.js
– /tmp/build_04904452/client/node_modules/@rollup/plugin-babel/dist/index.js
– /tmp/build_04904452/client/node_modules/workbox-build/build/lib/bundle.js
– /tmp/build_04904452/client/node_modules/workbox-webpack-plugin/build/generate-sw.js
– /tmp/build_04904452/client/node_modules/workbox-webpack-plugin/build/index.js
– /tmp/build_04904452/client/node_modules/react-scripts/config/webpack.config.js
– /tmp/build_04904452/client/node_modules/react-scripts/scripts/build.js (While processing: “/tmp/build_04904452/client/node_modules/babel-preset-react-app/prod.js”)
I’ve tried building the react app front end on my local linux machine and it builds successfully.
I tried installing babel/preset-env with no luck on Heroku.
I tried upgrading the version of @babel/plugin-proposal-private-property-in-object with no luck on Heroku.
I found the file in nodemodules exactly where the error is being thrown, but I have how to fix that since I have no control over the nodemodules and shouldn’t mess with them anyway.
I made sure my linux operating system packages, node js, npm, and all npm packages are completely up-to-date and it still won’t deploy.
Alex Geary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.