Skip to content

fix: disable lazy barrel in bundled dev (fix #22749)#22801

Closed
mturac wants to merge 1 commit into
vitejs:mainfrom
mturac:izon/fix-bundled-dev-date-fns-locale
Closed

fix: disable lazy barrel in bundled dev (fix #22749)#22801
mturac wants to merge 1 commit into
vitejs:mainfrom
mturac:izon/fix-bundled-dev-date-fns-locale

Conversation

@mturac

@mturac mturac commented Jun 28, 2026

Copy link
Copy Markdown

Description

Fixes #22749.

Full-bundle dev currently leaves Rolldown's lazy barrel optimization enabled. With barrel imports such as import { pl } from 'date-fns/locale', the generated dev bundle can retain references to symbols that are no longer declared (for example formatDistance$93), which crashes the entry before the app code runs.

This disables experimental.lazyBarrel only for bundled dev, next to the existing inlineConst workaround in the same code path.

Alternatives checked

  • Checked for duplicate open PRs for experimental.bundledDev crashes on date-fns locale imports #22749 and this bundled-dev/date-fns crash; none found.
  • Checked the published Rolldown version; 1.1.3 is still latest, so there is no dependency bump path yet.
  • Tried disabling treeshake; it did not fix the missing symbol output.
  • Tried disabling optimization.pifeForModuleWrappers; it did not fix the missing symbol output.

Tests

  • pnpm --filter vite run build
  • pnpm run test-serve bundled-dev
  • pnpm run test-build bundled-dev
  • pnpm run test-serve hmr-full-bundle-mode
  • pnpm exec oxfmt --check packages/vite/src/node/server/bundledDev.ts playground/bundled-dev/__tests__/bundled-dev.spec.ts playground/bundled-dev/main.js playground/bundled-dev/package.json playground/bundled-dev/vite.config.ts
  • pnpm exec eslint packages/vite/src/node/server/bundledDev.ts playground/bundled-dev/__tests__/bundled-dev.spec.ts playground/bundled-dev/main.js playground/bundled-dev/vite.config.ts
  • git diff --check

No documentation update is needed because this is an internal workaround for experimental full-bundle dev mode.

@mturac
mturac force-pushed the izon/fix-bundled-dev-date-fns-locale branch 3 times, most recently from 5c7a4b3 to 4be2141 Compare June 28, 2026 23:10
@mturac

mturac commented Jun 29, 2026

Copy link
Copy Markdown
Author

The remaining red check looks unrelated to this patch.

Build&Test: node-24, windows-latest failed in playground/hmr/__tests__/hmr.spec.ts:

  • page.waitForEvent: Timeout 30000ms exceeded while waiting for event "load"
  • unhandled rejection: Timeout waiting for browser logs. Waiting for: /connected/, />>>>>>/

The other Build&Test matrix jobs passed. This patch only touches bundled dev / the playground/bundled-dev regression fixture, and the PR body lists the local bundled-dev + hmr-full-bundle-mode validation that passed.

I tried to rerun failed jobs, but GitHub rejected it with: Must have admin rights to Repository. Could a maintainer rerun the failed Windows job when convenient?

@wojtekmaj

Copy link
Copy Markdown

I can confirm that this fixes the issue I reported.

@mturac
mturac force-pushed the izon/fix-bundled-dev-date-fns-locale branch from 4be2141 to 16379aa Compare July 4, 2026 11:41
@mturac
mturac force-pushed the izon/fix-bundled-dev-date-fns-locale branch from 16379aa to 4b7c09d Compare July 4, 2026 11:44
@sapphi-red

Copy link
Copy Markdown
Member

Thanks, but this was done on the Rolldown side: rolldown/rolldown#10060

@sapphi-red sapphi-red closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

experimental.bundledDev crashes on date-fns locale imports

3 participants