Skip to content

fix(docker): hoist react-router-dom in pnpm deploy to fix builder startup#24

Merged
vianmora merged 4 commits into
developfrom
fix/docker-hoist-react-router-dom
Jun 17, 2026
Merged

fix(docker): hoist react-router-dom in pnpm deploy to fix builder startup#24
vianmora merged 4 commits into
developfrom
fix/docker-hoist-react-router-dom

Conversation

@vianmora

Copy link
Copy Markdown
Collaborator

Summary

  • pnpm v9 avec autoInstallPeers: true résout react-router-dom comme peer dep de @remix-run/react plutôt que comme dep directe du builder
  • pnpm deploy --prod ne crée donc pas le symlink top-level → ERR_MODULE_NOT_FOUND au démarrage du container
  • Fix : apps/builder/.npmrc avec public-hoist-pattern[]=react-router-dom pour forcer le symlink lors du deploy

Test plan

  • Vérifier que le CI build l'image sans erreur
  • Vérifier que node_modules/react-router-dom existe (symlink) dans le container final
  • Démarrer le builder et confirmer qu'il n'y a plus d'erreur ERR_MODULE_NOT_FOUND

🤖 Generated with Claude Code

…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>
@vianmora vianmora merged commit 249969b into develop Jun 17, 2026
7 of 8 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