Skip to content

fix(config): skip native-loader compat warning when loader is explicit - #23352

Closed
volcanicll wants to merge 1 commit into
vitejs:mainfrom
volcanicll:fix/native-compat-warning-explicit-loader
Closed

fix(config): skip native-loader compat warning when loader is explicit#23352
volcanicll wants to merge 1 commit into
vitejs:mainfrom
volcanicll:fix/native-compat-warning-explicit-loader

Conversation

@volcanicll

Copy link
Copy Markdown

Fixes #23267

Summary

The (!) Your Vite config uses features that are unsupported by configLoader: 'native' warning fired even when the user explicitly set --config-loader=bundle (or a bundler loader via API). Since an explicit choice means the native loader will never be used, the warning is noise in that case.

Fix

Make configLoader optional in loadConfigFromFile so an unset value can be distinguished from an explicit 'bundle', and only emit the compat warning on the default path:

  • unset → defaults to 'bundle', warning fires (migration heads-up preserved)
  • explicit 'bundle' / 'runner' → no warning
  • explicit 'native' → bundler path not taken, no change

Test

  • Existing 8 native-incompatibility warning tests updated to call through the default path
  • Added regression test: explicit configLoader: 'bundle' produces no warnings
  • All 109 tests in config.spec.ts pass; tsc --noEmit passes

@btea

btea commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

It looks like it's a duplicate of #23275.

@btea btea closed this Aug 26, 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.

“native config loader incompatibilities” warning is shown even when setting a bundler explicitly

2 participants