[GH-ISSUE #28] vinext dev fails: cannot find @vitejs/plugin-rsc/rsc + unresolved react-server-dom-webpack/* in optimizeDeps.include #12

Closed
opened 2026-05-06 12:36:28 +02:00 by BreizhHardware · 5 comments

Originally created by @theg1239 on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/28

Running vinext dev in a Next 16.1.6 app fails during Vite startup. Vite can’t resolve react-server-dom-webpack/* entries listed in optimizeDeps.include, then throws an internal error because @vitejs/plugin-rsc/rsc can’t be found when importing virtual:vinext-rsc-entry.

After adding vite and @vitejs/plugin-rsc to resolve the missing @vitejs/plugin-rsc/rsc module error, vinext dev now fails during RSC evaluation with DM_Sans is not a function. This happens at app/layout.tsx when calling DM_Sans(...) from next/font/google.

  • vinext: ^0.0.4
  • vite: ^7.3.1
  • @vitejs/plugin-rsc: ^0.5.20
  • next: 16.1.6
  • react / react-dom: 19.2.4
  • Node: v22.22.0
  • pnpm: 10.27.0
  • OS: macOS 26.3 (Build 25D125)
Originally created by @theg1239 on GitHub (Feb 24, 2026). Original GitHub issue: https://github.com/cloudflare/vinext/issues/28 Running vinext dev in a Next 16.1.6 app fails during Vite startup. Vite can’t resolve react-server-dom-webpack/* entries listed in optimizeDeps.include, then throws an internal error because @vitejs/plugin-rsc/rsc can’t be found when importing virtual:vinext-rsc-entry. After adding vite and @vitejs/plugin-rsc to resolve the missing @vitejs/plugin-rsc/rsc module error, vinext dev now fails during RSC evaluation with DM_Sans is not a function. This happens at app/layout.tsx when calling DM_Sans(...) from next/font/google. - vinext: ^0.0.4 - vite: ^7.3.1 - @vitejs/plugin-rsc: ^0.5.20 - next: 16.1.6 - react / react-dom: 19.2.4 - Node: v22.22.0 - pnpm: 10.27.0 - OS: macOS 26.3 (Build 25D125)
Author
Owner

@theg1239 commented on GitHub (Feb 24, 2026):

After reviewing the README's limitations, I realize this is happening because of lightningcss

<!-- gh-comment-id:3954942212 --> @theg1239 commented on GitHub (Feb 24, 2026): After reviewing the README's limitations, I realize this is happening because of lightningcss
Author
Owner

@theg1239 commented on GitHub (Feb 24, 2026):

I suppose this might be relevant still so reopening

<!-- gh-comment-id:3954985383 --> @theg1239 commented on GitHub (Feb 24, 2026): I suppose this might be relevant still so reopening
Author
Owner

@southpolesteve commented on GitHub (Feb 25, 2026):

We want to make things work! So this is helpful feedback. Thank you. Will investigate lightningcss as a starting point but if you can have AI code up a simple repro that would be very helpful

<!-- gh-comment-id:3956413800 --> @southpolesteve commented on GitHub (Feb 25, 2026): We want to make things work! So this is helpful feedback. Thank you. Will investigate lightningcss as a starting point but if you can have AI code up a simple repro that would be very helpful
Author
Owner

@ts-76 commented on GitHub (Feb 25, 2026):

I can confirm I'm seeing the same DM_Sans issue on my end too.

From a quick look, packages/vinext/src/shims/font-google.ts only has a small set of static named exports ("common fonts" for IDE autocomplete), and DM_Sans isn’t included — so import { DM_Sans } from "next/font/google" ends up failing.

Quick question on the intended behavior:

For fonts not in the static named export list, is the expected vinext usage to go through the default Proxy (typically via a small app-side wrapper)?

e.g.:

import fontGoogle from "next/font/google";
export const DM_Sans = (options?: Parameters<typeof fontGoogle.DM_Sans>[0]) =>
  fontGoogle.DM_Sans(options);

To reduce wrapper overhead and keep runtime + d.ts in sync, could we generate next/font/google named exports from Next.js font definitions/metadata (instead of maintaining the manual list in packages/vinext/src/shims/font-google.ts)?

Sorry if I’m missing something — really enjoying vinext and cheering for the project.

P.S.
If you try installing react-server-dom-webpack, the @vitejs/plugin-rsc/rsc error will be fixed. I have also verified that if you upgrade react / react-dom to version 19.2.4, you don't even need to include react-server-dom-webpack in your root dependencies.

However, even after that, the DM_Sans font error still occurs.

I believe the issue lies with font definitions.

<!-- gh-comment-id:3957472007 --> @ts-76 commented on GitHub (Feb 25, 2026): I can confirm I'm seeing the same DM_Sans issue on my end too. From a quick look, packages/vinext/src/shims/font-google.ts only has a small set of static named exports ("common fonts" for IDE autocomplete), and DM_Sans isn’t included — so import { DM_Sans } from "next/font/google" ends up failing. Quick question on the intended behavior: For fonts not in the static named export list, is the expected vinext usage to go through the default Proxy (typically via a small app-side wrapper)? e.g.: ```typescript import fontGoogle from "next/font/google"; export const DM_Sans = (options?: Parameters<typeof fontGoogle.DM_Sans>[0]) => fontGoogle.DM_Sans(options); ``` To reduce wrapper overhead and keep runtime + d.ts in sync, could we generate next/font/google named exports from Next.js font definitions/metadata (instead of maintaining the manual list in packages/vinext/src/shims/font-google.ts)? Sorry if I’m missing something — really enjoying vinext and cheering for the project. P.S. If you try installing react-server-dom-webpack, the @vitejs/plugin-rsc/rsc error will be fixed. I have also verified that if you upgrade react / react-dom to version 19.2.4, you don't even need to include react-server-dom-webpack in your root dependencies. However, even after that, the DM_Sans font error still occurs. I believe the issue lies with font definitions.
Author
Owner

@rafayexalter commented on GitHub (Feb 25, 2026):

npm i -D react-server-dom-webpack

<!-- gh-comment-id:3960665194 --> @rafayexalter commented on GitHub (Feb 25, 2026): `npm i -D react-server-dom-webpack`
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#12
No description provided.