mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #310] [MERGED] fix: CSS imports from node_modules crash SSR #467
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#467
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/310
Author: @Divkix
Created: 3/7/2026
Status: ✅ Merged
Merged: 3/7/2026
Merged by: @james-elicx
Base:
main← Head:fix/node-modules-css-ssr-crash📝 Commits (5)
fa24376fix: CSS imports from node_modules crash SSR (#270)f04a5fffix: externalize better-sqlite3 and fix test hermiticityadfa82cfix: propagate user ssr.external into RSC and SSR environments5a42454fix: address review comments on node-modules CSS SSR crash fixd9dc009fix: address bonk review comments📊 Changes
12 files changed (+252 additions, -7 deletions)
View changed files
📝
packages/vinext/src/index.ts(+41 -3)📝
pnpm-lock.yaml(+16 -0)➕
tests/fixtures/app-basic/__test_packages__/fake-css-lib/index.js(+2 -0)➕
tests/fixtures/app-basic/__test_packages__/fake-css-lib/package.json(+1 -0)➕
tests/fixtures/app-basic/__test_packages__/fake-css-lib/styles.css(+1 -0)➕
tests/fixtures/app-basic/__test_packages__/fake-css-module-lib/index.js(+3 -0)➕
tests/fixtures/app-basic/__test_packages__/fake-css-module-lib/package.json(+1 -0)➕
tests/fixtures/app-basic/__test_packages__/fake-css-module-lib/styles.module.css(+1 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/node-modules-css/page.tsx(+12 -0)📝
tests/fixtures/app-basic/package.json(+3 -1)📝
tests/fixtures/ecosystem/better-auth/vite.config.ts(+4 -3)➕
tests/node-modules-css.test.ts(+167 -0)📄 Description
Summary
Fixes #270.
noExternal: trueon all server environments (Pages Router SSR, App Router RSC, App Router SSR) to force node_modules through Vite's transform pipeline instead of Node's native ESM loaderexternalpackages (react, satori, resvg, yoga-wasm-web) take precedence per Vite's rulesTest plan
tests/node-modules-css.test.ts— App Router + Pages Router tests with fake packages importing.cssand.module.css(2/2 passing)tests/nextjs-compat/app-css.test.ts) — no regression (4/4 passing)tests/features.test.ts) — no regression (231/231 passing)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.