Skip to content

Fix image compilation with Cloudflare adapter static output#17050

Merged
matthewp merged 1 commit into
mainfrom
flue/fix-16919
Jun 11, 2026
Merged

Fix image compilation with Cloudflare adapter static output#17050
matthewp merged 1 commit into
mainfrom
flue/fix-16919

Conversation

@astrobot-houston

Copy link
Copy Markdown
Contributor

Changes

  • Fixes image compilation regression for Cloudflare adapter users with static output. The image optimizer was looking in wrong directory (dist/_astro/ instead of dist/client/_astro/), causing ENOENT build failures.
  • Replaces hardcoded outDir usage with getClientOutputDirectory(settings) helper in prepareAssetsGenerationEnv() to respect preserveBuildClientDir setting.

Testing

  • Confirmed by issue reporter (@kitschpatrol) that the fix resolves the build failure
  • Existing core image test suite (207 tests) and preserve-build-client-dir tests (7 tests) continue to pass

Docs

  • No docs update needed, this fixes broken functionality to work as originally documented

Closes #16919

…tic builds with preserveBuildClientDir\n\nWhen an adapter sets preserveBuildClientDir (e.g. @astrojs/cloudflare), static builds\nemit images to build.client (dist/client/_astro/) but the image optimization step was\nlooking in outDir (dist/_astro/), causing ENOENT errors.\n\nReplace the hardcoded outDir fallback in prepareAssetsGenerationEnv with\ngetClientOutputDirectory(), which correctly respects the preserveBuildClientDir\nadapter feature.\n\nFixes #16919
@astrobot-houston astrobot-houston added the fix verified Reporter confirmed the triage bot fix works label Jun 11, 2026
@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Jun 11, 2026
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b57dafd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codspeed-hq

codspeed-hq Bot commented Jun 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing flue/fix-16919 (b57dafd) with main (de0bc19)

Open in CodSpeed

@matthewp matthewp merged commit ff59fcd into main Jun 11, 2026
31 checks passed
@matthewp matthewp deleted the flue/fix-16919 branch June 11, 2026 19:31
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: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression on image compilation with @astrojs/cloudflare adapter

2 participants