From bdd0398eb67e377d33e37b06301d006f5f3dbce7 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Thu, 7 May 2026 18:07:01 +0200 Subject: [PATCH] fix(PBI-58): pin turbopack root to cwd so worktrees resolve own node_modules Multi-lockfile setups (e.g. running dev/build from inside a git worktree under .claude/worktrees/) caused Next.js to climb up to the parent repo's package-lock.json and resolve modules from the parent's node_modules, which doesn't have the new manual-rendering deps installed. Pinning turbopack.root to process.cwd() keeps each invocation scoped to the directory it was launched from. Co-Authored-By: Claude Opus 4.7 (1M context) --- next.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/next.config.ts b/next.config.ts index 631b848..ad4d0ef 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,6 +5,11 @@ import pkg from "./package.json" const nextConfig: NextConfig = { reactStrictMode: true, serverExternalPackages: ['sharp'], + // Pin Turbopack workspace root to the invocation directory so worktrees + // resolve their own node_modules instead of climbing into an outer lockfile. + turbopack: { + root: process.cwd(), + }, env: { NEXT_PUBLIC_APP_VERSION: pkg.version, NEXT_PUBLIC_BUILD_DATE: new Date().toISOString(),