-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Open
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.
Description
Link to the code that reproduces this issue
https://github.com/domhede/turbopack-monorepo-repro
To Reproduce
- Clone the repo:
git clone https://github.com/domhede/turbopack-monorepo-repro - Install dependencies:
yarn install - Navigate to frontend:
cd apps/frontend - Run Vercel build:
npx vercel build
Current vs. Expected behavior
Expected: Build succeeds and produces a working standalone output.
Actual: Build fails with path doubling error:
Error: ENOENT: no such file or directory, lstat
'/path/to/apps/frontend/apps/frontend/.next/routes-manifest.json'
The path apps/frontend/ is doubled because outputFileTracingRoot causes the build to prepend the relative path from monorepo root, but we're already in that directory.
Provide environment information
- Node.js: 24.x
- Next.js: 15.3.3
- Vercel CLI: 50.4.0
Which area(s) are affected? (Select all that apply)
Turbopack, Output (standalone)
Which stage(s) are affected? (Select all that apply)
vercel build
Additional context
next.config.js:
const path = require("path");
module.exports = {
turbopack: {
root: path.resolve(__dirname, "../.."),
},
outputFileTracingRoot: path.resolve(__dirname, "../.."),
output: "standalone",
};Notes:
- Without
outputFileTracingRoot:turbopack.rootis ignored and module resolution fails for workspace packages - With
outputFileTracingRoot: Path doubling occurs during the build - There is currently no working configuration for Turbopack production builds in monorepos with shared packages
- Standard
next buildworks fine; the issue only occurs withvercel build
Metadata
Metadata
Assignees
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.