Skip to content

experimental.bundledDev fails to resolve virtual modules (breaks UnoCSS and Vue DevTools) #22864

Description

@Wyatex

Describe the bug

When enabling the experimental.bundledDev option in Vite, plugins that rely on injecting and serving Virtual Modules fail to work correctly.

I tested this with two major ecosystem plugins: unocss and vite-plugin-vue-devtools. Both broke simultaneously when bundledDev: true was enabled. It seems the dev server fails to resolve, bundle, or serve virtual modules, resulting in 404 errors or missing code.

Image

Reproduction

https://github.com/Wyatex/bundledDevBug

Steps to reproduce

  1. Scaffold a standard Vite + Vue project.
  2. Install unocss and vite-plugin-vue-devtools, and add them to the plugins array.
  3. Import virtual:uno.css in main.ts and use some utility classes.
  4. Enable experimental.bundledDev in vite.config.ts:
    export default defineConfig({
      experimental: {
        bundledDev: true
      },
      plugins: [
        VueDevTools(),
        UnoCSS(),
        vue(),
      ]
    })

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (16) x64 AMD Ryzen 7 8845HS w/ Radeon 780M Graphics     
    Memory: 29.31 GB / 61.79 GB
  Binaries:
    Node: 26.4.0 - C:\Users\wyate\AppData\Local\fnm_multishells\54680_1783304385204\node.EXE
    npm: 11.17.0 - C:\Users\wyate\AppData\Local\fnm_multishells\54680_1783304385204\npm.CMD
    pnpm: 11.9.0 - C:\Users\wyate\AppData\Local\fnm_multishells\54680_1783304385204\pnpm.CMD
    bun: 1.3.7 - C:\Users\wyate\.bun\bin\bun.EXE
    Deno: 2.9.0 - C:\Users\wyate\.deno\bin\deno.EXE
  Browsers:
    Chrome: 147.0.7727.139
    Edge: Chromium (149.0.4022.98)
    Internet Explorer: 11.0.26100.8115
  npmPackages:
    @vitejs/plugin-vue: ^6.0.7 => 6.0.7 
    vite: ^8.1.3 => 8.1.3

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: bundled-devp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions