Skip to content

fix(cloudflare): preserve passthrough image service in compile mode - #18032

Merged
matthewp merged 1 commit into
withastro:mainfrom
adamchal:fix-17968
Sep 16, 2026
Merged

matthewp merged 1 commit into
withastro:mainfrom
adamchal:fix-17968

Conversation

@adamchal

Copy link
Copy Markdown
Member

Changes

  • Gives passthroughImageService() precedence when using imageService: 'compile', fixing image requests during development and on-demand rendering.
  • Adds a warning when this overrides an explicitly configured runtime: 'cloudflare-binding'.

Testing

  • Adds test to cover passthrough precedence when combined with 'compile'.

Docs

N/a

Closes #17968

@changeset-bot

changeset-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c16ad0a

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

@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label Sep 16, 2026
@adamchal

Copy link
Copy Markdown
Member Author

@matthewp My concern with #18031 is that it overrides behavior and warns for all custom image services. This PR targets passthroughImageService() with 'compile' specifically.

The warning runs in astro:build:start, after integrations have finalized the image service. This catches an integration that introduces passthrough alongside an explicit runtime: 'cloudflare-binding'.

Endpoint selection still happens early. That means an integration-added passthrough service can miss the override: the build warning can detect the conflicting runtime configuration, but it doesn’t fix endpoint selection in that case. Dev requests—and production requests when using the binding runtime—can still fail.

I considered appending a separate integration to apply the override later, but that doesn’t guarantee ordering either. I’ve kept this fix scoped to directly configured passthrough rather than expanding it into a general solution for integration ordering.

The added tests cover passthrough precedence in dev and build. I didn’t add separate warning coverage. The focus is the endpoint behavior.

@matthewp

Copy link
Copy Markdown
Contributor

Sounds good, I'll close that one.

@matthewp
matthewp merged commit f7dbc6a into withastro:main Sep 16, 2026
24 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 16, 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cloudflare] Local image fails in dev with 400 Bad Request when using imageService: "compile"

2 participants