Skip to content

fix: hasBothRollupOptionsAndRolldownOptions should return false for proxy case - #22043

Merged
sapphi-red merged 2 commits into
vitejs:mainfrom
cyphercodes:fix-mergeconfig-warning
Mar 27, 2026
Merged

sapphi-red merged 2 commits into
vitejs:mainfrom
cyphercodes:fix-mergeconfig-warning

Conversation

@cyphercodes

@cyphercodes cyphercodes commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

When mergeConfig is called with only rollupOptions, the function setupRollupOptionCompat creates a proxy where rollupOptions points to rolldownOptions. Both properties exist but they reference the same object.

The function hasBothRollupOptionsAndRolldownOptions was incorrectly returning true in this case, causing false positive warnings.

This fix adds a check to ensure both properties are actually different objects before returning true.

Related Issue

refs #22040

Rayan Salhab and others added 2 commits March 26, 2026 18:34
…proxy case

When mergeConfig sets up rollupOptions to rolldownOptions proxy,
both properties exist but point to the same object. The function
hasBothRollupOptionsAndRolldownOptions should return false in this
case to avoid false positive warnings about both options being set.

Fixes vitejs#22040
@ghost ghost added the p2-edge-case Bug, but has workaround or limited in scope (priority) label Mar 27, 2026
@ghost ghost changed the title fix(utils): hasBothRollupOptionsAndRolldownOptions returns false for proxy case (fix #22040) fix: hasBothRollupOptionsAndRolldownOptions should return false for proxy case Mar 27, 2026
@ghost
ghost merged commit 99897d2 into vitejs:main Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-edge-case Bug, but has workaround or limited in scope (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants