[PR #132] [MERGED] fix: add missing react-server-dom-webpack to App Router examples #339

Closed
opened 2026-05-06 12:39:17 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/132
Author: @gentritbiba
Created: 2/26/2026
Status: Merged
Merged: 2/27/2026
Merged by: @FredKSchott

Base: mainHead: fix/examples-add-react-server-dom-webpack


📝 Commits (1)

  • c7d236e fix: add missing react-server-dom-webpack to App Router examples

📊 Changes

6 files changed (+20 additions, -0 deletions)

View changed files

📝 examples/app-router-cloudflare/package.json (+1 -0)
📝 examples/app-router-playground/package.json (+1 -0)
📝 examples/benchmarks/package.json (+1 -0)
📝 examples/hackernews/package.json (+1 -0)
📝 examples/nextra-docs-template/package.json (+1 -0)
📝 pnpm-lock.yaml (+15 -0)

📄 Description

Summary

  • Add react-server-dom-webpack as an explicit dependency to all App Router examples that were missing it: app-router-cloudflare, app-router-playground, benchmarks, hackernews, nextra-docs-template
  • Fixes client-side hydration being completely broken in dev mode — "use client" components rendered as static HTML with no interactivity

Closes #28

Root Cause

@vitejs/plugin-rsc correctly adds react-server-dom-webpack/client.browser to optimizeDeps.include for the client environment, but pnpm's strict module resolution prevents Vite from resolving it unless the package is explicitly listed in the project's package.json. This caused:

Failed to resolve dependency: react-server-dom-webpack/client.browser, present in client 'optimizeDeps.include'

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

  • Start examples/app-router-cloudflare with vite dev
  • Verify no Failed to resolve dependency warnings in console
  • Verify no ReferenceError: module is not defined in browser console
  • Verify "use client" Counter component increments on click

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/132 **Author:** [@gentritbiba](https://github.com/gentritbiba) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 2/27/2026 **Merged by:** [@FredKSchott](https://github.com/FredKSchott) **Base:** `main` ← **Head:** `fix/examples-add-react-server-dom-webpack` --- ### 📝 Commits (1) - [`c7d236e`](https://github.com/cloudflare/vinext/commit/c7d236e371bf2fe2b666ab9fb9bd716e16d1980a) fix: add missing react-server-dom-webpack to App Router examples ### 📊 Changes **6 files changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `examples/app-router-cloudflare/package.json` (+1 -0) 📝 `examples/app-router-playground/package.json` (+1 -0) 📝 `examples/benchmarks/package.json` (+1 -0) 📝 `examples/hackernews/package.json` (+1 -0) 📝 `examples/nextra-docs-template/package.json` (+1 -0) 📝 `pnpm-lock.yaml` (+15 -0) </details> ### 📄 Description ## Summary - Add `react-server-dom-webpack` as an explicit dependency to all App Router examples that were missing it: `app-router-cloudflare`, `app-router-playground`, `benchmarks`, `hackernews`, `nextra-docs-template` - Fixes client-side hydration being completely broken in dev mode — `"use client"` components rendered as static HTML with no interactivity Closes #28 ## Root Cause `@vitejs/plugin-rsc` correctly adds `react-server-dom-webpack/client.browser` to `optimizeDeps.include` for the client environment, but pnpm's strict module resolution prevents Vite from resolving it unless the package is explicitly listed in the project's `package.json`. This caused: ``` Failed to resolve dependency: react-server-dom-webpack/client.browser, present in client 'optimizeDeps.include' ``` 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 - [x] Start `examples/app-router-cloudflare` with `vite dev` - [x] Verify no `Failed to resolve dependency` warnings in console - [x] Verify no `ReferenceError: module is not defined` in browser console - [x] Verify `"use client"` Counter component increments on click --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:17 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#339
No description provided.