`@vitejs/plugin-rsc` build fails on Vite 8.0.8 with Deno 2.7
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- deno, react, typescript, vite
- 領域
- build-system, tooling
調査の方向性
まず @vitejs/plugin-rsc の virtual:vite-rsc/assets-manifest の処理と Vite 8/Rolldown Environment API を確認し、その後 gleez/deno-rsc-starter で失敗を再現します。Vite 7 と Vite 8 の build パスを比較します。vite build が Vite 8.0.8 と Deno 2.7 で外部の workaround プラグインなしに成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Related plugins
Describe the bug
Environment
- Vite:
7.x→ 8.0.8 (regression) @vitejs/plugin-rsc:0.5.23- Runtime: Deno 2.7
The build fails only during vite build (dev mode works fine) with the following error:
[plugin rsc:virtual:vite-rsc/assets-manifest]
AssertionError: The expression evaluated to a falsy value:
assert(this.environment.mode === "dev")
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(this.environment.mode === "dev")
Root Cause
Vite 8 switched to Rolldown (Rust-based bundler) and introduced changes to the Environment API and virtual module handling. This exposed two issues in @vitejs/plugin-rsc:
- Virtual modules prefixed with
virtual:vite-rsc/are not properly recognized by Rolldown unless they are explicitly prefixed with the standard\0(null byte) convention. - The
assets-manifestvirtual plugin still reaches the strictassert(this.environment.mode === "dev")during production builds, even though the plugin contains logic to treat it asexternal: truein build mode.
Required Workarounds
To make builds succeed on Vite 8 + Deno 2.7, we currently need these two patches (placed early in the plugins array, before rsc()):
Patch 1: virtual-rsc-scheme-fix.ts (fixes virtual module resolution - in dev and build)
import type { Plugin } from 'vite';
export function virtualRscSchemeFix(): Plugin {
return {
name: 'virtual-rsc-scheme-fix',
enforce: 'pre' as const,
resolveId(id: string) {
if (id.startsWith('virtual:vite-rsc/')) {
return '\0' + id; // Standard virtual module prefix for Rolldown/Vite
}
},
};
}
Patch 2: fix-rsc-assets-manifest-build.ts (forces correct build behavior)
import { Plugin } from 'vite';
export function fixRscAssetsManifestBuild(): Plugin {
return {
name: 'fix-rsc-assets-manifest-build',
enforce: 'pre' as const,
resolveId(source) {
if (source === 'virtual:vite-rsc/assets-manifest') {
if (this.environment?.mode === 'build') {
return { id: source, external: true };
}
}
},
};
}
Plugin order is very sensitive — moving these patches earlier in the array (or changing the order of other plugins) can make the build succeed or fail.
Additional Context
- Uses a full multi-environment setup (
rsc,ssr,client) with@deno/vite-plugin. - Worked reliably on Vite 7.
- The combination of Rolldown’s stricter virtual module handling + Deno’s npm compatibility layer appears to trigger the issue more easily.
Reproduction
Steps to reproduce
No response
System Info
Vite: 7.x → 8.0.8 (regression)
@vitejs/plugin-rsc: 0.5.23
Runtime: Deno 2.7
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
- 主要言語
- TypeScript
- スター
- 1.2k
- フォーク
- 287
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vitejs/vite-plugin-react のほかの issue
-
plugin-rsc: a client reference's CSS is linked before the CSS of the chunks it imports (build)対応中かも @wozhenbang2004 が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
vitejs/vite-plugin-react#1570 ·
メンテナーはふだん 1 日以内に返信
-
pending triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
vitejs/vite-plugin-react#1581 ·
メンテナーはふだん 1 日以内に返信
-
[plugin-rsc] Build exits 0, but the app fails at runtime: a server action imported only by browser code is missing from the RSC build対応中かも @NeilPant が 4 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
vitejs/vite-plugin-react#1578 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
vitejs/vite-plugin-react#1577 ·
メンテナーはふだん 1 日以内に返信
-
[plugin-rsc] inline "use server" function declarations lose hoisting and throw TDZ ReferenceError対応中かも @draarivpatel-ui が 3 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
vitejs/vite-plugin-react#1566 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
vitejs/vite-plugin-react の issue をすべて見る
似ている issue
-
good first issue help wanted
難易度 2/5 1時間未満 初心者へのやさしさ 86/100
Intelligenza-Umana/intelligenza-umana-web#16 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-webui/open-webui#35184 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
danielmiessler/LifeOS#3001 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信