fix(config): close bundles when generation fails - #23256
Merged
bluwy merged 1 commit intoAug 21, 2026
Merged
Conversation
bluwy
reviewed
Aug 19, 2026
NgoQuocViet2001
force-pushed
the
fix-config-bundle-close-on-error
branch
from
August 19, 2026 13:12
73aa08d to
82bff6c
Compare
bundleConfigFile closed its Rolldown bundle only after a successful generate() call. If config generation failed, the bundle stayed open and its plugin and native resources were never finalized. Close it in a finally block so both the successful and the failing path release it.
NgoQuocViet2001
force-pushed
the
fix-config-bundle-close-on-error
branch
from
August 20, 2026 08:58
82bff6c to
7c2d5ef
Compare
bluwy
approved these changes
Aug 21, 2026
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
bundleConfigFileclosed its Rolldown bundle only after a successfulgenerate()call. If config generation failed, the bundle remained open and its plugin/native resources were not finalized.Close the config bundle in a
finallyblock so both the successful and the failing generation path release it.Validation
pnpm --filter vite typecheckpnpm exec eslint packages/vite/src/node/config.tspnpm exec oxfmt --check packages/vite/src/node/config.tsThe regression test that was here originally has been dropped at review request â it needed mocking to force
generate()to reject, and the fix is small enough not to warrant it.