fix: add missing react-server-dom-webpack to App Router examples#132
Merged
FredKSchott merged 1 commit intocloudflare:mainfrom Feb 27, 2026
Merged
Conversation
App Router examples were missing react-server-dom-webpack as an explicit dependency. With pnpm's strict module resolution, this caused the Vite dev server to fail resolving react-server-dom-webpack/client.browser, breaking client-side hydration — "use client" components rendered as static HTML with no interactivity. The @vitejs/plugin-rsc correctly adds react-server-dom-webpack to optimizeDeps.include, but the package must be resolvable from the project root. Without it in package.json, pnpm cannot link it.
Collaborator
|
LGTM! Thanks @gentritbiba ! |
commit: |
southpolesteve
added a commit
that referenced
this pull request
Feb 27, 2026
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
react-server-dom-webpackas an explicit dependency to all App Router examples that were missing it:app-router-cloudflare,app-router-playground,benchmarks,hackernews,nextra-docs-template"use client"components rendered as static HTML with no interactivityCloses #28
Root Cause
@vitejs/plugin-rsccorrectly addsreact-server-dom-webpack/client.browsertooptimizeDeps.includefor the client environment, but pnpm's strict module resolution prevents Vite from resolving it unless the package is explicitly listed in the project'spackage.json. This caused:The CJS file was served raw to the browser, resulting in
ReferenceError: module is not defined, which broke React's RSC client integration and all hydration.Test plan
examples/app-router-cloudflarewithvite devFailed to resolve dependencywarnings in consoleReferenceError: module is not definedin browser console"use client"Counter component increments on click