Skip to content

docs: worktree-only Turbopack panic when website .next caches exist - #871

Merged
blove merged 1 commit into
mainfrom
blove/document-turbopack-worktree-panic
Aug 30, 2026
Merged

docs: worktree-only Turbopack panic when website .next caches exist#871
blove merged 1 commit into
mainfrom
blove/document-turbopack-worktree-panic

Conversation

@blove

@blove blove commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes the last open follow-up from the worktree investigation. Docs-only.

nx build cockpit panics in a git worktree — FileSystemPath(…).join(…) leaves the filesystem root — whenever any website .next cache exists in the workspace: apps/website/.next (left by next dev / the website e2e) or dist/apps/website (left by a build). Those caches contain a node_modules symlink whose relative target routes through the main checkout's root. The path is valid on disk; Turbopack's virtual filesystem refuses to traverse above its project root and panics.

What I verified before writing a word of documentation:

  • Reproduced with both cache locations independently (the second one surfaced only after the first was cleared — my initial single-cause model was wrong).
  • Pinning turbopack.root does not fix it — tested, same two panics. The error message's own suggestion is a dead end for this case.
  • Clearing the caches does: build goes exit 1 → exit 0.
  • CI never hits this: its checkouts are fresh and not nested inside another checkout.

A real fix belongs upstream (Turbopack rejecting a disk-valid symlink), so the honest artifact here is the documented workaround in CONTRIBUTING's worktree section:

rm -rf apps/website/.next dist/apps/website && npx nx build cockpit

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview Aug 30, 2026 6:53pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@blove
blove enabled auto-merge (squash) August 30, 2026 14:46
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

nx build cockpit dies with 'FileSystemPath(...).join(...) leaves the
filesystem root' in a git worktree whenever apps/website/.next or
dist/apps/website exists. The caches hold a node_modules symlink whose
relative target routes through the MAIN checkout's root — valid on disk,
but Turbopack's virtual filesystem refuses to traverse above its project
root. Verified: pinning turbopack.root does NOT fix it; clearing the
caches does (build goes 1 -> 0). CI is unaffected (fresh, un-nested
checkouts).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@blove
blove force-pushed the blove/document-turbopack-worktree-panic branch from 2b4e14f to 567bfbd Compare August 30, 2026 18:48
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit fd47bd3 into main Aug 30, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant