Conversation
…orkspace resolution Without a source condition, Turbopack lazily compiles workspace packages through their dist/ files. When @jonmatum/next-shell/auth was the first subpath resolved in a fresh Turbopack session (e.g. /dashboard as the initial route), the module couldn't be resolved — likely a race in Turbopack's symlink + package exports resolution during the first compilation pass. Adding "source": "./src/<path>.ts" to every export entry tells Turbopack to compile from TypeScript source directly when the package is resolved as a workspace symlink. This is the standard pattern for pnpm monorepo library packages with Next.js 15 / Turbopack. The source condition is ignored by non-Turbopack consumers (Node CJS require, standard ESM bundlers) since they don't recognize it, so published behavior is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jonmatumdev
approved these changes
Apr 17, 2026
Collaborator
jonmatumdev
left a comment
There was a problem hiding this comment.
All checks passed. AI review found no issues. Auto-approved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
"source": "./src/<path>.ts"to every export inpackage.json.Root cause: Turbopack lazily resolves workspace packages through their
dist/files. When@jonmatum/next-shell/authwas the very first subpath compiled in a fresh session (e.g./dashboardas the initial route after a server redirect), Turbopack failed to resolve it withModule not found. Navigating to any other route in the(shell)group first would warm the cache and fix it — confirming a lazy-compilation race specific to the first module boundary crossing.Fix: The
sourcecondition tells Turbopack to compile from TypeScript source directly when the package is a workspace symlink. This is the standard pattern for pnpm monorepo library packages. The condition is ignored by all other consumers (Node require, webpack, standard ESM bundlers).Verification