Skip to content

fix(cloudflare): use generic image endpoint in dev mode for compile imageService - #17800

Open
ghubo wants to merge 1 commit into
withastro:mainfrom
ghubo:fix/cloudflare-compile-image-dev-endpoint
Open

fix(cloudflare): use generic image endpoint in dev mode for compile imageService#17800
ghubo wants to merge 1 commit into
withastro:mainfrom
ghubo:fix/cloudflare-compile-image-dev-endpoint

Conversation

@ghubo

@ghubo ghubo commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Fixes an issue where @astrojs/cloudflare with imageService: "compile" assigned @astrojs/cloudflare/image-transform-endpoint in development mode (astro dev).
  • When paired with passthroughImageService(), format conversion is disabled (delete options.format), omitting f= from the /_image query string. This caused the Cloudflare transform endpoint to crash with 400 Bad Request (Unsupported format: null).
  • Updates case "compile": in packages/integrations/cloudflare/src/utils/image-config.ts to use GENERIC_ENDPOINT (astro/assets/endpoint/generic) when command === "dev", matching the behavior of custom.
  • Added changeset for @astrojs/cloudflare.

Testing

  • Added unit tests in packages/integrations/cloudflare/test/image-config.test.ts verifying that imageService: "compile" resolves to astro/assets/endpoint/generic in dev mode and CLOUDFLARE_PASSTHROUGH_ENDPOINT in build mode.
  • Verified that tests fail on the unpatched code (AssertionError: Expected 'astro/assets/endpoint/generic', got '@astrojs/cloudflare/image-transform-endpoint') and pass with 0 errors when the fix is applied.
  • Tested locally in an Astro project with imageService: "compile" and passthroughImageService() to verify <Image /> components load with HTTP 200 in dev.

Docs

No documentation changes needed.

@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c6174b

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

This PR includes changesets to release 44 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-cache Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-cache-provider Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-custom-image-service Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile-fetch-state Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-custom-image-service Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/cloudflare-incremental-images 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/astro-cloudflare-prerenderer-render-error 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 Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: integration Related to any renderer integration (scope)

1 participant