Fix Cloudflare adapter circular import with custom fetchFile#16968
Merged
Conversation
…lar import crash (#16956)
1 task
🦋 Changeset detectedLatest commit: a44f707 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 |
matthewp
approved these changes
Jun 5, 2026
Merged
matthewp
pushed a commit
that referenced
this pull request
Jun 8, 2026
* fix(errors): correct param key in getStaticPaths error-doc examples (slug → id) (#16976) * fix(cloudflare): defer createApp/setGetEnv in fetch.ts to avoid circular import crash (#16956) (#16968) * fix(fetch): sync request.url with forwarded headers in FetchState (#16947) * fix(fetch): sync request.url with forwarded headers in FetchState (#16945) * chore: improve tests and solution --------- Co-authored-by: astrobot-houston <fred+astrobot@astro.build> * chore: avoid an unwanted mdx major bump (#16977) * chore(renovate): bump max memory (#16993) --------- Co-authored-by: Minh Lê <115204145+DucMinhNe@users.noreply.github.com> Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <estoppa@cloudflare.com> Co-authored-by: astrobot-houston <fred+astrobot@astro.build> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
florian-lefebvre
added a commit
that referenced
this pull request
Jun 8, 2026
Co-authored-by: astrobot-houston <fred+astrobot@astro.build> Co-authored-by: Minh Lê <115204145+DucMinhNe@users.noreply.github.com> Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <estoppa@cloudflare.com> Co-authored-by: ocavue <ocavue@users.noreply.github.com> fix(errors): correct param key in getStaticPaths error-doc examples (slug → id) (#16976) fix(cloudflare): defer createApp/setGetEnv in fetch.ts to avoid circular import crash (#16956) (#16968) fix(fetch): sync request.url with forwarded headers in FetchState (#16947) fix(fetch): sync request.url with forwarded headers in FetchState (#16945)
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.
Changes
createApp()andsetGetEnv()initialization in@astrojs/cloudflare/fetchto the firstcf()callfetchFilestatically importscffrom@astrojs/cloudflare/fetchensureInitialized()helper to break the module evaluation cycleTesting
fetch-lazy-init.test.tscovering customfetchFilescenarios with static importsadvancedRouting: true(boolean) usageDocs
Closes #16956