Skip to content

vite 8.0.13 regression in dev mode with bundledDev:true and react lazy loading with resolve.alias #22454

Description

@baevm

Describe the bug

This appears to be a regression in Vite after 8.0.10. When using vite with experimental.bundledDev: true, lazy loading in React can fail in dev mode.

The same reproduction works correctly with Vite 8.0.10, but fails with Vite 8.0.13.

[email protected] example:

2026-05-15.15.42.29.mov

With [email protected], all lazy imports fail on the first click, but work correctly after a page refresh:

2026-05-15.15.56.42.mov

If I disable experimental.bundledDev in [email protected], everything works correctly.

Reproduction

https://github.com/baevm/vite-rolldown-lazy-import-repro

Steps to reproduce

  1. npm run dev
  2. All lazy loaded pages fail on first load in dev mode
  3. Install [email protected]
  4. Open the same pages again, they all load without errors.

System Info

System:
    OS: macOS 15.6.1
    CPU: (12) arm64 Apple M4 Pro
    Memory: 379.55 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.14.0 - /Users/baevm/.nvm/versions/node/v24.14.0/bin/node
    npm: 11.9.0 - /Users/baevm/.nvm/versions/node/v24.14.0/bin/npm
    pnpm: 10.17.1 - /opt/homebrew/bin/pnpm
    bun: 1.2.22 - /opt/homebrew/bin/bun
    Deno: 2.4.5 - /opt/homebrew/bin/deno
  Browsers:
    Chrome: 148.0.7778.168
    Safari: 18.6
  npmPackages:
    @vitejs/plugin-react: ^6.0.2 => 6.0.2
    vite: 8.0.13 => 8.0.13

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions