fix(optimize-deps): avoid "unsupported" warnings for browser:false mappings - #23590
Merged
sapphi-red merged 2 commits intoSep 30, 2026
Merged
Conversation
9 of 18 tasks
sapphi-red
approved these changes
Sep 30, 2026
kazupon
added a commit
to kazupon/vrowzer
that referenced
this pull request
Sep 30, 2026
) * chore(vite-dev-server): update optimizeDeps.include comment Port vitejs/vite#23489 (6a84c7210). * fix(vite-dev-server): don't skip imports whose binding starts with type Port vitejs/vite#23540 (39330f489). * chore(vite-dev-server): add debug log when waiting for dep before init Port vitejs/vite#23566 (63567c73a). * fix(vite-dev-server): resolve pending discovered dep processing on close before init Port vitejs/vite#23567 (5f894339d). * fix(vite-dev-server): preserve excluded optional peer require fallbacks Port vitejs/vite#23600 (a2bd6fa89). * fix(vite-dev-server): pass queries to renderBuiltUrl Port vitejs/vite#23586 (744269e5b). The html.ts part is not ported because buildHtmlPlugin does not exist in this fork. Update the asset URL tests for the new placeholder format, where the postfix is carried in URL metadata instead of trailing the token. * fix(vite-dev-server): avoid unsupported warnings for browser:false mappings Port vitejs/vite#23590 (5e4b9ca3d).
Merged
This was referenced Oct 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.
Some packages use
browser: falsein their package settings to say an import should be empty in the browser. Vite's dependency optimizer currently treats that import like an unsupported Node module. As a result, it shows warnings when the package reads properties from the empty module.The two cases already have different internal IDs. A
browser: falseimport uses__vite-browser-externalwithout a suffix. An unsupported Node module uses__vite-browser-external:<id>. This change loads an empty module for the first case and keeps the existing warning for the second. It adds a test for a package with abrowser: falsemapping. The existing tests still check warnings for unsupported Node modules.In the reproduction for #23512, this removes 23 warnings from PostCSS without changing the page's CSS output. A
node:fsimport that is not mapped tofalsestill warns. Build and preview behavior is unchanged. The reproduction gist's lockfile needs its absolute package paths changed tonode_modules/beforenpm ciworks; that lockfile is not changed here.Fixes #23512.
Patch drafted with AI assistance (Grok 4.7). I reviewed it and ran the monorepo build, Vite typecheck, the optimizer unit tests, the optimize-deps serve and build playground tests, lint, and formatting.