fix: ssr.optimizeDeps dependency resolution warnings with pnpm dev#3698
Draft
fredericoo wants to merge 2 commits intomainfrom
Draft
fix: ssr.optimizeDeps dependency resolution warnings with pnpm dev#3698fredericoo wants to merge 2 commits intomainfrom
pnpm dev#3698fredericoo wants to merge 2 commits intomainfrom
Conversation
pnpm dev
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
set-cookie-parser and cookie are CJS transitive dependencies of react-router. Listed by bare name in ssr.optimizeDeps.include, Vite can't resolve them with pnpm's strict hoisting because transitive deps aren't accessible from the project root. Using Vite's `parent > child` nested dependency syntax (e.g. `react-router > cookie`) tells Vite to resolve through react-router's own node_modules, which works with strict package managers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The express, multipass, and partytown recipes all patch the skeleton's vite.config.ts ssr.optimizeDeps.include array. Update the patch context lines, READMEs, and LLM prompts to match the new multi-line format using `react-router > dep` nested resolution syntax. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c6d2b7b to
ef6d10f
Compare
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.
WHY are these changes introduced?
A freshly scaffolded Hydrogen app shows two warnings on
dev:cookieandset-cookie-parserare CJS transitive dependencies ofreact-router. Listed by bare name inssr.optimizeDeps.include, Vite can't resolve them with pnpm's strict hoisting — transitive deps aren't accessible from the project root.WHAT is this pull request doing?
Uses Vite's nested dependency syntax (
react-router > dep) to resolve throughreact-router's ownnode_modules. This is the documented approach for strict package managers like pnpm.HOW to test your changes?
pnpm create @shopify/hydrogen@latestpnpm run devFailed to resolve dependencywarnings in the consoleChecklist
I've added tests to cover my changesI've added or updated the documentation