简体   繁体   中英

Having trouble deploying my Rails app on Heroku I get this - Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

I am working on a rails application. This application has been running fine, and I have successfully deployed it to Heroku many times. I recently made a lot of changes including adding Tailwindcss, as well as many database changes. The app works locally but when I deploy to Heroku I get:

ERROR in ./app/javascript/packs/application.js
remote:        Module build failed (from ./node_modules/babel-loader/lib/index.js):
remote:        Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

Any insight into why this will work locally but fail to deploy would be helpful

I was having a similar issue in the CI pipeline for a Rails application.

Per https://github.com/JeffreyWay/laravel-mix/issues/2383#issuecomment-683538859 I did the following to resolve my issue:

  1. Added "@babel/preset-env": "7.9.0" to package.json (by the time you read this the version is likely out of date)
  2. Ran yarn install --check-files
  3. Ran bin/rails webpacker:install
  4. Ran bin/rails webpacker:compile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM