Nextjs Deployment Fails on Promote Stage

Question:
what else should I try when troubleshooting a failure on the promote stage?

  • works when using npm run dev and npm run start.
  • tried deleting the .next folder.
  • tried updating the dependencies in package.json.
  • tried on both autoscale and reserved vm.
  • maybe .replit file needs to be configured for next 14? :thinking:

Repl link/Link to where the bug appears: https://replit.com/@shphrd/vision2text

Screenshots, links, or other helpful context:

.replit config:

[deployment]
build = ["npm", "install", "&&", "npm", "run", "build"]
run = ["tsx", "index.ts"]
deploymentTarget = "cloudrun"
ignorePorts = false

build as an array just spawns a single process, so that shouldn’t work. How about you prepend npm install&& to the build script and use just npm run build in the build array?

1 Like

success :tada:

next.js generates a BUILD_ID during next build to identify which version of your app is being served.

  1. replace npm run build with :white_check_mark: next build
  2. replace tsx index.ts with :white_check_mark: next start

1 Like

Appreciate your comment, it gave me an idea that led to the solution. Ty!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.