#V5 upgrade 404 images locally [404] /_image

1 messages · Page 1 of 1 (latest)

fiery swallow
#

After upgrading a codebase to v5.0.2 i get [404] /_image on the images.
Does not impact the build just local dev.

lofty estuary
#

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.

carmine vigil
#

Are you guys using squoosh?

fiery swallow
#

no, but i am using unpic (to get React support)

carmine vigil
#

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?

fiery swallow
#

I started with 5.0.1

carmine vigil
#

And it also did not work there?

fiery swallow
#

no it didn't

#

if i switch back to the branch with 4.16.9 it is fine

carmine vigil
#

Hmm interesting

Are you using the built in Image component or generating something with getImage?

fiery swallow
#

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

carmine vigil
#

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?

fiery swallow
#

yep that correct

carmine vigil
fiery swallow
#

yes that right

carmine vigil
#

@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?

wary coral
#

Sure. Could you open an issue on the Unpic repo, with a repro?

carmine vigil
#

@fiery swallow

fiery swallow
#

I will see if I can replicate it in a starter repo

fiery swallow
#

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?

acoustic brook
fiery swallow
#

@acoustic brook that was it thank you! didn't think about that being and issue!

wary coral
#

You should be able to update @unpic/astro and then trailing slashes will work

unborn chasm
#

Who (in the world) (even) invented trailing slashes?

acoustic brook
#

Yeah... Using it because the only i18n package that does what I want requires it.