Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astro 5.4 breaks custom Image Services #13335

Closed
1 task
amxmln opened this issue Feb 28, 2025 · 6 comments · Fixed by #13336
Closed
1 task

Astro 5.4 breaks custom Image Services #13335

amxmln opened this issue Feb 28, 2025 · 6 comments · Fixed by #13336
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: assets Related to the Assets feature (scope) regression

Comments

@amxmln
Copy link

amxmln commented Feb 28, 2025

Astro Info

Astro                    v5.4.0
Node                     v22.13.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             client:if
                         @astrojs/vue

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

After the upgrade to Astro 5.4, builds no longer work if they are using a custom image service which relied upon isRemoteAllowed because the export was moved to a different file.

It used to be exported as part of the astro/assets/utils package, but now seems to reside under @astrojs/internal-helpers/remote, which suggests it is no longer part of a public API.

This is a breaking change (even though for a limited amount of users) and should at least be documented if it was intentional.

Thanks for keeping up the great work on Astro!

What's the expected result?

Custom image services should keep working without changes.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-txiuvwma?file=integrations/custom-image-service.js&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Feb 28, 2025
@florian-lefebvre
Copy link
Member

isRemoteAllowed is not documented in our docs so I'm not sure we can consider it a public API before 5.4 actually. @Princesseuh what do you think?

@Princesseuh
Copy link
Member

Princesseuh commented Feb 28, 2025

I'm almost sure I wrote a README somewhere to explain that they're exported, not sure where though as I can't find it now. But yes, the files in that folder were purposely exported for other services to use!

@amxmln
Copy link
Author

amxmln commented Feb 28, 2025

The docs suggest that custom image services should be based on the provided image services, hence why I assumed that all the properties used in those would be public API. They are also listed as exports in Astro’s package.json.

I feel like I had also read about them in a README or the docs when I first built this service, but I can’t find any reference anymore either.

@florian-lefebvre florian-lefebvre added - P3: minor bug An edge case that only affects very specific usage (priority) feat: assets Related to the Assets feature (scope) regression and removed needs triage Issue needs to be triaged labels Feb 28, 2025
@ematipico ematipico self-assigned this Feb 28, 2025
@ematipico
Copy link
Member

@amxmln can you please test this preview? #13336 (comment)

Let us know if it fixes your issue

@amxmln
Copy link
Author

amxmln commented Feb 28, 2025

@ematipico thanks for looking at this so quickly!

I can confirm that installing the preview package fixes the build, however, Vite now spits out the following warning, which didn’t happen before:

[WARN] [vite] "matchHostname", "matchPort", "matchPathname", "matchProtocol" and "matchPattern" are imported from external module "@astrojs/internal-helpers/remote" but never used in "node_modules/astro/dist/assets/services/service.js" and "node_modules/astro/dist/assets/utils/remotePattern.js".

@ematipico
Copy link
Member

I think it's expected because @astrojs/internal-helpers wasn't published with the preview release.

On Monday we will release the patch, so the warning shouldn't be there. If there is, feel free to re-open the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: assets Related to the Assets feature (scope) regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants