繁体   English   中英

Heroku 未找到模块:错误:无法解析“-/firebase-config”

[英]Heroku Module not found: Error: Can't resolve '-/firebase-config'

我正在尝试将 React 项目部署到 Heroku,但是在将文件推送到 Heroku master 分支时,构建失败,因为“找不到模块:错误:无法解析‘/tmp/中的‘-/firebase-config’” build_0de13186/src'”。

我怎样才能重新添加/恢复这个丢失的模块? 它是本地丢失还是远程丢失?

我的 React 项目由一个服务器和一个客户端组成,它们都位于同一个根文件夹中。 服务器和客户端都有自己的 package.json 安装了 firebase。

     remote: -----> Build
remote:        Running build
remote:        
remote:        > fullstackapp@0.1.0 build
remote:        > react-scripts build
remote:        
remote:        Creating an optimized production build...
remote:        Failed to compile.
remote:        
remote:        Module not found: Error: Can't resolve '-/firebase-config' in '/tmp/build_0de13186/src'
remote:        
remote:        
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        Some possible problems:
remote:        
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:        
remote:        Love,
remote:        Heroku
remote:        
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: b577f7b18ab92dd19ec0a6e615586f97af15d9f6
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version b577f7b18ab92dd19ec0a6e615586f97af15d9f6
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to fullstackapp-portfolio.
remote: 
To https://git.heroku.com/fullstackapp-portfolio.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fullstackapp-portfolio.git'

带有客户端文件的前端文件夹与 server.js 一起位于根目录 map

Firebase-config.js 我位于前端文件夹根目录中。 导入失败的 firebase-config.js 发生在 Frontend 文件夹内 --> App。

fjs

暂无
暂无

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

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