Build completes successfully but deployment never starts

Description:

I’m deploying a Nuxt 4 app from a pnpm monorepo and experiencing an issue where the build completes successfully, but Vercel never proceeds to the deployment phase. The deployment just sits in a pending state until it hits the 45-minute timeout limit.

Setup:

  • Framework: Nuxt 4.2.0 with Nitro 2.12.9

  • Package Manager: pnpm 10.12.3 (monorepo)

  • Root Directory: blog (set in Vercel project settings)

  • Framework Preset: Nuxt.js (auto-detected)

What’s happening:

  1. :white_check_mark: Dependencies install successfully (1688 packages)

  2. :white_check_mark: Build runs successfully - all modules transformed, no errors

  3. :white_check_mark: Build completes with message: [success] [nitro] You can deploy this build using npx vercel deploy --prebuilt

  4. :cross_mark: Deployment never starts - just hangs silently until timeout

Build output (final lines):

  • [info] [@nuxt/image] sharp binaries have been included in your build for linux-x64. Make sure you deploy to the same architecture.
    [success] [nitro] You can deploy this build using npx vercel deploy --prebuilt

After this, nothing happens. No deployment phase begins, no errors are shown.

Additional context:

Question:
Why would Vercel successfully build but never proceed to deployment? Is there something in the .output directory structure that Vercel needs to detect the build is ready for deployment?

Hi @samuel-4300, I’m sorry you are facing this issue.

Is your Vercel project detecting the correct Framework preset in the Project Build settings? Make sure the defaults match your build script/output.

Can you also try running vercel build from your machine and see if the outcome is any difference?

1 Like

Normally if this happens locally it’s because a module has registered a watcher or something that needs to be cleaned up.

Can you reproduce locally by running VERCEL=1 pnpm run build? As a debugging step, would you try adding another step in your build command, eg. pnpm run build && echo done so you can visually see if the nuxt build process has finished or not?

2 Likes

Thanks a lot for the quick replies – really appreciate it! Especially nice to see you in here @danielroe. After following your debugging suggestions I managed to figure out a temporary workaround, but I think it’s worth documenting what I did on my end since it might point to a deeper issue for investigation and I hope there’s a better fix that can free me of my current workaround.

When testing locally earlier, I initially thought the build was completing fine on my end. But after trying again with your suggestion, I realized the same issue happens locally too – it’s just a bit more subtle. The terminal reports that the build has completed, but the process doesn’t actually exit. I can still press Cmd+C afterward to return to the prompt, which means the Node process is hanging even though the build appears done.

My ugly workaround was to add a Nitro hook to force the process to exit:

nitro: {
  hooks: {
    close: () => {
      if ((process.env.VERCEL || process.env.CI) && process.env.NODE_ENV === 'production') {
        process.exit(0)
      }
    }
  }
}

That fixed the hanging issue, but it seemingly introduced another one: once I added the hook, the build started failing because my tsconfig.json extends from "./.nuxt/tsconfig.json", which apparently isn’t accessible when Vite parses it during the build – maybe as a side effect of the hook I added? I had to remove the extends and inline the config to get it working again.

So everything builds now, but I’m no longer extending from the .nuxt tsconfig. It seems like something in Nitro’s lifecycle is keeping the event loop alive when it should have exited cleanly. It might also affect other CI environments where the process needs to terminate automatically.

Does this sound like a known issue, or something that might need a deeper look on the Nuxt/Nitro side?
For the record, this is all happening in my side project – which is a public repo. You can likely reproduce the issue by forking the monorepo, removing the Nitro hook I added, and trying to deploy the blog app to Vercel on your end - or just trying to build and observing that the process doesn’t return back to the terminal prompt when its “done.”

Repo:

2 Likes

Im having the same issue.
I ran all these commands
`vercel build, `VERCEL=1 bun run build , `bun run build && echo done`
and got the same result. I can cancel the process and run vercel deploy and that works.

2 Likes

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