Heroku heroku-nextjs buildpack 构建失败

时间:2021-03-26 20:28:45

标签: reactjs heroku next.js buildpack

我使用免费帐户在 Heroku 中创建了一个应用程序。

这是我的第一个 Nextjs 应用程序。我创建了一些 React 应用并使用 https://github.com/mars/create-react-app-buildpack buildpack 成功部署了它们,

我正在尝试使用 https://github.com/mars/heroku-nextjs.git buildpack。推送和尝试构建时,我继续收到以下错误:

Enumerating objects: 695, done.
Counting objects: 100% (695/695), done.
Delta compression using up to 4 threads
Compressing objects: 100% (638/638), done.
Writing objects: 100% (695/695), 406.94 KiB | 1.78 MiB/s, done.
Total 695 (delta 388), reused 20 (delta 13)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/mars/heroku-nextjs.git
remote: -----> App not compatible with buildpack: https://github.com/mars/heroku-nextjs.git
remote:        bash: /tmp/codon/tmp/buildpacks/cc998aa50faebde1ea66717737aec22c884e4936/bin/detect: No such file or directory
remote:
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: b1006412ec2d412e7edaed795dcbceff02d98f82
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version b1006412ec2d412e7edaed795dcbceff02d98f82
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 gurnzapp-test.

我已经阅读了我可以在网上找到的所有关于此的内容。 github 问题中最常见的错误是人们将 package.json 放在子目录中。我的 package.json 位于根目录中。据我所知,我的项目设置正确。

我试过了:

我不知道为什么我会遇到构建问题。任何帮助都会很棒:D

1 个答案:

答案 0 :(得分:1)

remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/mars/heroku-nextjs.git
remote: -----> App not compatible with buildpack: https://github.com/mars/heroku-nextjs.git
remote:        bash: /tmp/codon/tmp/buildpacks/cc998aa50faebde1ea66717737aec22c884e4936/bin/detect: No such file or directory
remote:
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed

上面写着App not compatible with buildpack

这不是构建包:
https://github.com/mars/heroku-nextjs

这些是构建包:
https://github.com/mars/create-react-app-buildpack
https://github.com/heroku/heroku-buildpack-nodejs

您可以忽略此构建包。它什么都不做。
https://github.com/ryanbahniuk/nextjs-buildpack

在此处阅读 buildpack 的工作原理:
https://devcenter.heroku.com/articles/buildpacks