mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #18] [CLOSED] fix: auto-exclude react-server packages from RSC optimizeDeps #247
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/18
Author: @FredKSchott
Created: 2/24/2026
Status: ❌ Closed
Base:
main← Head:fix/rsc-optimizedeps-react-server📝 Commits (1)
e3b7ea2fix: auto-exclude react-server packages from RSC optimizeDeps📊 Changes
1 file changed (+103 additions, -1 deletions)
View changed files
📝
packages/vinext/src/index.ts(+103 -1)📄 Description
Summary
Packages with a
react-serverexport condition (e.g.swr) get pre-bundled with a stripped-down entry in the RSC environment, breaking client imports (likeuseSWR) before the RSC plugin's"use client"transform can strip them.At startup, scan the project's direct dependencies for packages declaring a
react-serverexport condition and automatically add them toenvironments.rsc.optimizeDeps.exclude.Uses
createRequirefor resolution so it works across all package managers.Ref: https://github.com/vitejs/vite-plugin-react/issues/736, https://github.com/vitejs/vite-plugin-react/issues/775
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.