fix(docker): hoist react-router-dom in pnpm deploy to fix builder startup#24
Merged
Merged
Conversation
…rtup pnpm v9 with autoInstallPeers=true resolves react-router-dom as a peer dependency of @remix-run/react rather than as a direct dep, so pnpm deploy --prod omits the top-level node_modules symlink. Node cannot find the package at runtime → ERR_MODULE_NOT_FOUND crash on startup. Adding public-hoist-pattern in apps/builder/.npmrc forces pnpm deploy to create the top-level symlink regardless of peer resolution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pnpm v9 with autoInstallPeers=true does not create a top-level symlink for react-router-dom in pnpm deploy --prod: it treats it as provided via @remix-run/react peer resolution, so Node fails at runtime with ERR_MODULE_NOT_FOUND. Replace the .npmrc public-hoist-pattern approach (which only affects workspace installs, not pnpm deploy) with an explicit ln -sf from the virtual store in the Dockerfile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous fix used an absolute path (/standalone/node_modules/.pnpm/...) which breaks when the runner stage copies node_modules from /standalone to /app — the symlink still pointed to /standalone which no longer exists. pnpm creates all its symlinks as relative paths; match that convention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
autoInstallPeers: truerésoutreact-router-domcomme peer dep de@remix-run/reactplutôt que comme dep directe du builderpnpm deploy --prodne crée donc pas le symlink top-level →ERR_MODULE_NOT_FOUNDau démarrage du containerapps/builder/.npmrcavecpublic-hoist-pattern[]=react-router-dompour forcer le symlink lors du deployTest plan
node_modules/react-router-domexiste (symlink) dans le container finalERR_MODULE_NOT_FOUND🤖 Generated with Claude Code