#V5 upgrade 404 images locally [404] /_image
1 messages · Page 1 of 1 (latest)
Same here, since the upgrade to V5. However here i have no issues at all when running it locally, when deployed to a production server however all the images fail with an 404.
Are you guys using squoosh?
no, but i am using unpic (to get React support)
Ah
Figured it might be squoosh getting removed, but clearly not that for you 😅
Did this only happen after 5.0.2? was it working on 5.0.0/1?
I started with 5.0.1
And it also did not work there?
Hmm interesting
Are you using the built in Image component or generating something with getImage?
Im using the unpic image component (mainly in react) with the setting set to Astro. So is generating urls like: src="/_image?href=https%3A%2F%2Fstage-site.com/male-student-on-apron.jpg"
I did try using the built in import { Image } from 'astro:assets';
but same result
they are coming from a remote source if that makes any difference
And I assume nothing changed other than the upgrade from 4 to 5 right? You still have your remote image sources in your config and such?
yep that correct
This component right? https://github.com/ascorbic/unpic-img
yes that right
@wary coral
When you get some time could you possibly take a gander at this? Maybe something weird with the library and the v5 upgrade?
Sure. Could you open an issue on the Unpic repo, with a repro?
@fiery swallow
I will see if I can replicate it in a starter repo
frustratingly I cannot replicate it in another repo, doesn't feel like it is unpic as that is generating the correct src urls.
Anywhere I can throw a debugger? what fires up the /image route?
Are you using trailing slash? Could be realated to this https://github.com/ascorbic/unpic/issues/141
Starting from Astro 5 (now in beta), the image endpoint might have trailing slash depending on the trailingSlash config. That is, if it's set to always, then the image endpoint would be /_image...
@acoustic brook that was it thank you! didn't think about that being and issue!
You should be able to update @unpic/astro and then trailing slashes will work
Who (in the world) (even) invented trailing slashes?
Yeah... Using it because the only i18n package that does what I want requires it.