fix(cloudflare): resolve vite plugin config once across call sites#16868
Merged
matthewp merged 4 commits intoMay 26, 2026
Merged
Conversation
User options like remoteBindings, inspectorPort, persistState, configPath, and auxiliaryWorkers were silently dropped during astro preview because the preview entrypoint only received the adapter-computed half of the config. Resolve the full @cloudflare/vite-plugin config once at integration setup time so every call site (dev/build, prerenderer, preview) spreads a single merged object and cannot accidentally drop user options.
🦋 Changeset detectedLatest commit: 62774cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 37 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
… preview Verifies that astro preview honors remoteBindings: false when a wrangler binding is flagged remote: true. Confirmed to fail before the fix in b4946e2 — wrangler.maybeStartOrUpdateRemoteProxySession throws from the @cloudflare/vite-plugin preview path because the option is dropped.
cc796bb to
7dea3a0
Compare
Contributor
|
Looks great, thanks! |
matthewp
approved these changes
May 26, 2026
Open
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.
User options like remoteBindings, inspectorPort, persistState, configPath, and auxiliaryWorkers were silently dropped during astro preview because the preview entrypoint only received the adapter-computed half of the config.
Fixes #16867
Changes
cloudflare({...})(remoteBindings,inspectorPort,persistState,configPath,auxiliaryWorkers) being silently dropped duringastro preview. The preview entrypoint was only receiving the adapter-computed half of the@cloudflare/vite-pluginconfig viaglobalThis.@cloudflare/vite-pluginconfig exactly once atastro:config:setuptime. All three call sites (dev/build plugin, prerenderer preview server,astro previewentrypoint) now spread a single pre-mergedcfPluginConfig. The unmerged adapter-only half is a localconstthat goes out of scope, so no future call site can accidentally drop user options.remoteBindings: falsepriority over wrangler settings inconsistent during build #16705 (fixed for the prerenderer in fix(cloudflare): respect remoteBindings during prerender build #16707). This closes the equivalent gap on theastro previewpath and structurally prevents it from recurring.Testing
I've tested it with local npm patch, let me know if we have some e2e tests for these
Docs
No docs added, just a fix