Vercel deploys invalid version of turborepo app

Hey everyone we are running an issue where pushing a change to our repo rebuilds both of our apps (cms and web). The cms app is fine but the web part is no longer accessible throwing this error when visiting the website:

The deployment also cant be found in the deployment logs, pushing a change actually affecting the app fixes this or redeploying a past deployment.

The app not to deploy since it wasn’t affected. And perhaps even a fallback to the previous successful deployment?

  1. Enable automatic deployments for each app
  2. Push a code change affecting neither app (like a readme or github config file)
  3. Wait for Vercel to deploy
  4. Visit the deployed website

We are running a turborepo project split into web (astro ) and cms (nextjs) part. Deployed on Vercel. This is the repo btw GitHub - usemarble/marble: A simple way to publish articles, product updates and changelogs to your site.

It’s great to see you here, @mezotv! Thank you for posting and welcome to the Community :grinning_face_with_smiling_eyes:

Have you had a chance to check out our debugging 404 errors post? It might be helpful while you’re digging into this.

Looking at your issue, it seems like Vercel is rebuilding both apps in your Turborepo even when only non-app files are changed and as a result, the web app ends up deploying in an invalid state.

This usually happens because Vercel’s default behavior is to rebuild all linked projects whenever any file changes, even if those changes don’t affect the apps themselves.

A few things you can try:

First, you can configure an ignored build step in your web app’s vercel.json so that Vercel only rebuilds when certain files change:

{
  "ignoreCommand": "git diff HEAD^ HEAD --quiet ./src ./public ./package.json ./astro.config.mjs"
}

Next, since you’re already using Turborepo, you can take advantage of Turbo’s built-in filtering. In your Vercel project settings, set your build command to:

turbo build --filter=web...

This ensures that only the web app (or its dependencies) gets built when relevant files are updated.

You can also double-check your turbo.json configuration to make sure dependency mappings are set up correctly, so Turbo knows when each app actually needs to rebuild.

Let us know how you get on!

1 Like

Ill give those a try thank you!

Its weird because when I change 1 app the other one doesn’t deploy and it works fine as seen below:

Hey we tried the suggestions and it seems like the issue persists, is there anything else we can try/do?