繁体   English   中英

在 Heroku 上部署我的 Rails 应用程序时遇到问题 - 错误:找不到模块 '@babel/compat-data/corejs3-shipped-proposals'

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

我正在开发一个 Rails 应用程序。 这个应用程序一直运行良好,我已经多次成功地将它部署到 Heroku。 我最近做了很多更改,包括添加 Tailwindcss,以及许多数据库更改。 该应用程序在本地运行,但是当我部署到 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'

任何有关为什么这将在本地工作但无法部署的见解都会有所帮助

我在 Rails 应用程序的 CI 管道中遇到了类似的问题。

根据https://github.com/JeffreyWay/laravel-mix/issues/2383#issuecomment-683538859我做了以下事情来解决我的问题:

  1. "@babel/preset-env": "7.9.0"到 package.json (当您阅读本文时,版本可能已过时)
  2. Ran yarn install --check-files
  3. Ran bin/rails webpacker:install
  4. Ran bin/rails webpacker:compile

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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