Skip to content

fix(config): close bundles when generation fails - #23256

Open
NgoQuocViet2001 wants to merge 1 commit into
vitejs:mainfrom
NgoQuocViet2001:fix-config-bundle-close-on-error
Open

fix(config): close bundles when generation fails#23256
NgoQuocViet2001 wants to merge 1 commit into
vitejs:mainfrom
NgoQuocViet2001:fix-config-bundle-close-on-error

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown

Description

bundleConfigFile closed its Rolldown bundle only after a successful generate() call. If config generation failed, the bundle remained open and its plugin/native resources were not finalized.

Close the config bundle in a finally block so both successful and failed generation paths release it. Add a regression test that forces generate() to reject and verifies close() still runs.

Validation

  • pnpm exec vitest run packages/vite/src/node/__tests__/configBundleClose.spec.ts
  • pnpm --filter vite typecheck
  • pnpm exec eslint packages/vite/src/node/config.ts packages/vite/src/node/__tests__/configBundleClose.spec.ts
  • pnpm exec oxfmt --check packages/vite/src/node/config.ts packages/vite/src/node/__tests__/configBundleClose.spec.ts

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.

1 participant