[英]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.我正在开发一个 Rails 应用程序。 This application has been running fine, and I have successfully deployed it to Heroku many times.这个应用程序一直运行良好,我已经多次成功地将它部署到 Heroku。 I recently made a lot of changes including adding Tailwindcss, as well as many database changes.我最近做了很多更改,包括添加 Tailwindcss,以及许多数据库更改。 The app works locally but when I deploy to Heroku I get:该应用程序在本地运行,但是当我部署到 Heroku 时,我得到:
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.我在 Rails 应用程序的 CI 管道中遇到了类似的问题。
Per https://github.com/JeffreyWay/laravel-mix/issues/2383#issuecomment-683538859 I did the following to resolve my issue:根据https://github.com/JeffreyWay/laravel-mix/issues/2383#issuecomment-683538859我做了以下事情来解决我的问题:
"@babel/preset-env": "7.9.0"
to package.json (by the time you read this the version is likely out of date)将"@babel/preset-env": "7.9.0"
到 package.json (当您阅读本文时,版本可能已过时)yarn install --check-files
Ran yarn install --check-files
bin/rails webpacker:install
Ran bin/rails webpacker:install
bin/rails webpacker:compile
Ran bin/rails webpacker:compile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.