GUIDES · BUILD CONFIGURATION

Vercel monorepo build fails: set Root Directory and workspace installs

Fix Vercel builds that run from the wrong monorepo folder, cannot find package.json, or fail to resolve workspace dependencies in apps/web.

The monorepo symptom

Your repository contains apps/web and packages/ui, but the Vercel project was imported with the repository root selected as the application. Build logs may show a missing framework, an unexpected package.json, or a build command running in the wrong folder.

A monorepo repository and a Vercel project are not the same thing. Each deployable app needs the correct project settings even when they share one Git repository.

Configure the actual application root

In Vercel Project Settings → Build and Deployment, set Root Directory to the directory of the app you intend to ship, such as apps/web. Review Framework Preset, Build Command and Output Directory at the same time.

Do not add an invented rootDirectory field to vercel.json: project Root Directory belongs in Vercel project settings. A file-based setting at the wrong path may never be read.

Keep the workspace dependency graph intact

A pnpm, npm or Yarn workspace app may import packages from outside its own folder. Ensure the lockfile and workspace definitions are committed and the install sees shared packages. If your Vercel setup offers including files outside the Root Directory, verify that setting for internal packages.

An error resolving @acme/ui may be an install/workspace issue rather than a TypeScript path-alias problem. Test a clean install from the same workspace root that CI uses.

Verify per-project deployment settings

In one repository with two Vercel projects, a change to apps/web should build the web project and a change to apps/admin should build the admin project. Confirm the deployed output matches the intended sub-app and that the correct Git Production Branch is selected.

Reference: Vercel documentation for Monorepos and Project Settings. DeployDoctor can flag some build configuration problems but cannot read private dashboard-only Root Directory settings from a public repo scan.

Updated 2026-10-21