Skip to content

Static asset imports fail to load on first page load in dev mode with bundledDev: true #22596

Description

@baevm

Describe the bug

Static asset imports, such as background: url('./somebg.jpg') in css, fail to load the first time a page is opened when bundledDev: true is enabled. After a page refresh, they load correctly.

2026-06-03.18.51.20.mov

They load correctly on the first page load if I disable bundledDev.

I’m not sure whether it’s related, but there was a similar issue involving React lazy loading and bundledDev: #22454

Reproduction

https://github.com/baevm/vite-rolldown-lazy-import-repro/tree/assets-load-reproduction (branch assets-load-reproduction)

Steps to reproduce

  1. npm install
  2. npm run dev
  3. Open page 4 (it imports background image in css and svg in react component)
  4. Assets not loaded
  5. Refresh page
  6. Assets loaded

System Info

System:
    OS: macOS 15.6.1
    CPU: (12) arm64 Apple M4 Pro
    Memory: 1.22 GB / 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: 11.1.3 - /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.216
    Safari: 18.6
  npmPackages:
    @vitejs/plugin-react: ^6.0.2 => 6.0.2
    vite: 8.0.16 => 8.0.16

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions