#23028·Vite

Tracking: playground tests skipped under bundled dev mode

Author: h-a-n-aCreated Jul 23, 2026Updated Sep 23, 2026
Labelsfeat: bundled-dev

This issue tracks every playground test that is skipped under bundled dev mode (experimental.bundledDev). The goal is to shrink the list to zero.

How the suite runs

The test infra landed in #23027.

  • Command: pnpm run test-serve-bundled. It runs the whole playground e2e suite with experimental.bundledDev forced on for every playground (env var VITE_TEST_BUNDLED_DEV=1, no per-playground config changes).
  • CI runs it as the Test serve (bundled dev) step.

A test that does not pass yet is skipped in one of two ways:

  • Most cases in the file fail → the whole spec file is listed in bundledDevExclude in vitest.config.e2e.ts.
  • Only a few cases fail → the file stays enabled, and each failing case is marked test.skipIf(isBundledDev) or describe.skipIf(isBundledDev) (isBundledDev comes from ~utils).

The skipped tests still run in normal serve and build modes.

To close a skip: fix the behavior, or decide that the bundled-dev behavior is correct and update the assertion. Then remove the skip.

Harness note: until the first bundle is ready, bundled dev serves a fallback page that reloads itself. vitestSetup.ts waits for the real page after page.goto, with a 15s limit so a playground whose first bundle fails on purpose still runs (hmr-full-bundle-mode is exempt — it asserts the fallback page itself). Without this wait, test results depend on timing.

Baseline numbers

From the baseline run on main @ 34af7b7 (2026-07-23, freshly built dist):

  • 495 failing tests + 2 crashing suites in 47 spec files (out of 1284 tests in 108 files).
  • 531 tests skip only under bundled dev: the 497 baseline failures, documented over-skips in shared helpers, and 5 more found while stabilizing the suite (3× should have no 404s in assets / chunk-importmap / legacy, css > css import from js, hmr > CSS HMR with this.addWatchFile).
  • Two backend-integration tests skip only on Windows under bundled dev.

Why most of them fail

In bundled dev, the server serves the output of a rolldown bundle from memory. It does not serve single source files by URL the way normal dev does. Most failures come from that one difference. Minimal example — same import, different URL:

javascript
import imgUrl from './nested/asset.png'
// normal dev:  '/nested/asset.png'          (read from disk, transformed on request)
// bundled dev: '/assets/asset-C1hss4aq.png' (bundle output, served from memory)

A URL that is not a bundle output has no handler: the server answers 404 or falls back to the HTML page. This also means the fs.allow / fs.deny checks never run — a denied file returns 404 or the fallback page instead of 403.

Failure classes

# class playgrounds (skips) notes
1 Asset URLs are bundle-output paths, not source paths assets (122), assets-sanitize (2), html (16, partly), css (14, partly) The tests expect dev-style source-path URLs. Decision needed: keep source-path URLs in bundled dev, or accept hashed URLs and update the assertions.
2 Only bundle outputs are served: static and /@fs/ URLs return 404; fs.allow/fs.deny answers 404 or the fallback page instead of 403 fs-serve (108) Verified safe: denied files are never served, and no content leaks. But fetches of allowed files also return 404, so apps that fetch() files inside fs.allow break. Needs a static-file + fs-check middleware behind the bundle lookup.
3 HMR gaps hmr (42, incl. 2 crashing acceptExports suites), hmr-ssr (1) Owned by the HMR redesign work.
4 Workers worker (50) Worker bundling works differently under bundled dev (iife worker bundles, no HMR client inside workers).
5 Dep optimizer interplay optimize-deps (51), optimize-deps-no-discovery (1) Timeouts and empty pages. The optimizer's URLs and metadata do not match how bundled dev serves files.
6 Sourcemaps css-sourcemap (16, incl. 3 lightningcss snapshot mismatches), js-sourcemap (9) Includes serving sourcemaps for lazy chunks.
7 Import-map / CSP / misc long tail chunk-importmap (9), csp (5), tailwind (4), resolve (4), dynamic-import (4), css-lightningcss (4), backend-integration (4), tailwind-v3 (3), legacy (3), glob-import (3), forward-console (3), css-codesplit (3), tsconfig-json-load-error (2), transform-plugin (2), json (2), environment-react-ssr (2), env (2), wasm (1), tsconfig-json (1), object-hooks (1), module-graph (1), extensions (1), css-no-codesplit (1), css-lightningcss-root (1) Most of these follow from classes 1–2 (URL shapes, files not served), plus small per-feature gaps. Un-skip a test to see its current error.

How to work on one skip

  1. Remove the spec file from bundledDevExclude in vitest.config.e2e.ts. If the file is already enabled and only a few cases fail, remove the skipIf(isBundledDev) from those cases instead.
  2. Run just that playground: pnpm run test-serve-bundled <playground-name>.
  3. Fix the behavior, or update the assertion if the bundled-dev behavior is the intended one. Keep the file enabled.

Checklist (per playground)

The live checklist is kept in https://github.com/vitejs/vite/issues/23028#issuecomment-5190734145 and is updated as work lands.