mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #41] [MERGED] fix: eliminate react-dom/server.edge dual-import Rollup warning in SSR entry #263
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#263
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/41
Author: @nianyi778
Created: 2/25/2026
Status: ✅ Merged
Merged: 2/27/2026
Merged by: @FredKSchott
Base:
main← Head:fix/ssr-entry-dual-import📝 Commits (3)
23417ddfix: use static import for renderToStaticMarkup to eliminate dual-import warningb1abe1cRemove comment on renderToStaticMarkup importbe43fc8Remove unneccesary test📊 Changes
2 files changed (+2 additions, -2 deletions)
View changed files
📝
packages/vinext/src/server/app-dev-server.ts(+1 -2)📝
tests/app-router.test.ts(+1 -0)📄 Description
Problem
The generated SSR entry module (
generateSsrEntry()) importsreact-dom/server.edgein two ways:import { renderToReadableStream } from "react-dom/server.edge"handleSsr):const { renderToStaticMarkup } = await import("react-dom/server.edge")Rollup detects this mixed static+dynamic import pattern and emits a warning on every production build:
This is cosmetic (the build succeeds), but it's noisy — especially for projects that suppress it via
onwarnworkarounds in theirvite.config.ts.Fix
Add
renderToStaticMarkupto the existing static import at the top of the generated SSR entry, and remove the redundant dynamicimport(). The module was already loaded — the dynamic import added no lazy-loading benefit sincehandleSsr()runs unconditionally during SSR andrenderToReadableStreamfrom the same module is always available.Verification
Tested with a vinext App Router project (Cloudflare Workers):
vinext buildtsccompiles without errors🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.