Fix autoconfig for Astro 6+ projects to skip wrangler config generation#12856
Fix autoconfig for Astro 6+ projects to skip wrangler config generation#12856edmundhung merged 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 3af5fdf The changes in this PR will be included in the next version bump. 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 |
|
✅ All changesets look good |
|
I'm Bonk, and I've done a quick review of your PR. This PR makes autoconfig skip wrangler config generation for Astro 6+ projects (which generate their own wrangler config on build), by checking the installed Astro version with Issues found:
The rest of the changes look correct — the null-handling for |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
|
Codeowners approval required for this PR:
Show detailed file reviewers |
| // From version 6 Astro doesn't need a wrangler config file but generates a redirected config on build | ||
| return { | ||
| wranglerConfig: null, | ||
| }; |
There was a problem hiding this comment.
Out of curiosity: if there is no wrangler config, how does astro decide the worker name in the generated config? based on the directory?
There was a problem hiding this comment.
package.json name, then directory
edmundhung
left a comment
There was a problem hiding this comment.
@dario-piotrowicz I think you need to remove quarantine: true from the test config too.
|
|
Co-authored-by: Edmund Hung <edmund@cloudflare.com>
good call! 🫡 Done: 3af5fdf |
|
Oh weird. I assumed it would be a bit smarter there. That's not great |

Astro 6+ generates its own wrangler configuration on build, so autoconfig now detects the Astro version and skips creating a
wrangler.jsoncfile for projects using Astro 6 or later. This prevents conflicts between the autoconfig-generated config and Astro's built-in config generation.A picture of a cute animal (not mandatory, but encouraged)