Heroku heroku-nextjs buildpack 构建失败

Heroku heroku-nextjs buildpack build failed

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

这是我的第一个 Nextjs 应用程序。我创建了一些 React 应用程序并使用 https://github.com/mars/create-react-app-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

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

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