Skip to content

Conversation

@eya46
Copy link

@eya46 eya46 commented Nov 21, 2025

After upgrading to the latest Astro (>=5.15.9), all SVG images stopped displaying.

Issues found:

  • With passthroughImageService enabled, SVG images return Content-Type: image/null and fail to render (JPG works).

After downgrading Astro, the regression starts at 5.15.9.
Related issues:

delete newOptions.format; -> "Content-Type": mime.lookup(format) ?? `image/${format} -> Browser Content-Type: image/null -> image boom (svg)

Changes

I believe the issue in #14721 originates from the options.format = DEFAULT_OUTPUT_FORMAT assignment in service.ts.
To address this, I added a flag to prevent setting a default output format when the noop service is used.

Although my JPG images still return image/null (but browsers can display them), SVG images now work correctly.

before:
image

image

after:
image

image

Testing

I wasn’t sure how to write it.

Docs

There shouldn't be much to change. This aligns better with the note in #configure-no-op-passthrough-service
stating that Note that Astro does not perform any image transformation and processing in these environments.

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2025

🦋 Changeset detected

Latest commit: 8a10f23

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: astro Related to the core `astro` package (scope) label Nov 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 21, 2025

CodSpeed Performance Report

Merging #14861 will not alter performance

Comparing eya46:fix-noop-bug (8a10f23) with main (78ed8b5)1

Summary

✅ 6 untouched

Footnotes

  1. No successful run was found on main (7d67434) during the generation of this report, so 78ed8b5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant