Skip to content

Fix Cloudflare adapter image service default for static output#16934

Open
astrobot-houston wants to merge 1 commit into
mainfrom
flue/fix-16931
Open

Fix Cloudflare adapter image service default for static output#16934
astrobot-houston wants to merge 1 commit into
mainfrom
flue/fix-16931

Conversation

@astrobot-houston
Copy link
Copy Markdown
Contributor

Changes

  • Fixes image 404s when using @astrojs/cloudflare adapter with static output and no explicit imageService config
  • Makes normalizeImageServiceConfig() output-mode-aware: defaults to 'compile' for static output, 'cloudflare-binding' for server output
  • Moves image service normalization into astro:config:setup hook where config.output is available
  • Maintains backward compatibility for all existing configurations

Testing

  • Added packages/integrations/cloudflare/test/units/image-config.test.ts with 7 test cases covering static/server defaults, explicit overrides, and compound configs
  • Verified existing image service test suites pass (static, compile, binding, dev endpoint, external)

Docs

  • No docs update needed, this fixes the default behavior to match user expectations for static sites

Closes #16931

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 31, 2026

🦋 Changeset detected

Latest commit: 6ad4e74

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 37 packages
Name Type
@astrojs/cloudflare Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@test/astro-cloudflare Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sessions Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/cf-user-optimize-deps Patch
@test/astro-cloudflare-vite-plugin Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch

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

@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix verified Reporter confirmed the triage bot fix works pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@astrojs/cloudflare: default imageService generates 404s with static output

1 participant