[WIP] Fix onwarn reads from wrong config key in Vite 8 branch#3
Closed
[WIP] Fix onwarn reads from wrong config key in Vite 8 branch#3
Conversation
Copilot stopped work on behalf of
yunus25jmi1 due to an error
March 22, 2026 18:08
yunus25jmi1
pushed a commit
that referenced
this pull request
Mar 28, 2026
* Add production coverage for global-error compat * Address global-error review feedback * docs: update tracker notes for tests #3 and cloudflare#4 to reflect production preview coverage
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.
Cloud agent has begun work on fix(vite-8): remove ... and will update this pull request as work progresses.
Original prompt
last week
Review submitted successfully. Here's a summary of what I flagged on PR cloudflare#548:
Requested Changes (6 inline comments)
Bug: onwarn reads from wrong config key in Vite 8 branch — The Vite 8 rolldownOptions branch captures config.build?.rollupOptions?.onwarn to
preserve user warning handlers, but Vite 8 users would configure onwarn under rolldownOptions. The user's onwarn is silently dropped. Suggested fix:
read from both rolldownOptions and rollupOptions to cover the transition.
Multi-env Vite 8 path is untested — The integration test at line 436 asserts result.environments.client.build.rollupOptions.treeshake (Vite 7
shape). On Vite 8, getClientBuildOptionsWithInput() returns rolldownOptions instead, so this test doesn't cover the Vite 8 multi-env path at all.
Duplicated onwarn closure — The 15-line onwarn factory is copy-pasted across both the Vite 7 and Vite 8 branches. Suggested extracting into a
createDirectiveOnwarn() helper.
Broad as any cast — The entire Vite 8 build config is cast as any (line 1353), disabling type checking for that whole branch. Suggested a narrower
escape hatch.
Near-identical getClientBuildOptions / getClientBuildOptionsWithInput — These two functions share ~95% logic and differ only by an optional input
field. Suggested collapsing into a single function with an optional parameter.
Unverified moduleSideEffects: "no-external" support in Rolldown — The comment claims this is supported, but no verification has been documented. If
Rolldown doesn't support it, the barrel-library DCE optimization is silently lost.
github run
yunus25jmi1 added 4 commits 2 hours ago
@yunus25jmi1
fix: address bonk review comments for Vite 8/Rolldown
1e6744e
@yunus25jmi1
fix: resolve merge conflict and apply robust onwarn logic
029d279 ...
Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.