Commit 1e0c12b
committed
fix(config): prepend bun export condition under bun runtime
When running the dev server under `bun --bun`, `_resolveExportConditions`
only pushed "node" to Vite's resolve conditions. This caused Vite's
ModuleRunner to load srvx's and h3's Node adapters inside the dev worker,
returning a srvx `NodeResponse` to `Bun.serve` — which Bun rejects, falling
back to its default response and breaking every `/_nitro/*` request with a
Parse Error.
Detect Bun via `"Bun" in globalThis` (matching the existing pattern in
`src/presets/vercel/utils.ts`) and prepend "bun" so it wins for packages
declaring both conditions, while keeping "node" for packages that only
declare "node". Pure Node setups are unchanged.
Closes #42281 parent feebdc1 commit 1e0c12b
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
0 commit comments