next <Image> 500 error
Answered
Polar bear posted this in #help-forum
Polar bearOP
Hello! I’ve had no issues until this week… I’ve been using next in my site - deployed in Azure and locally - for the past 8 months without issue.
Today I deployed a new build and mysteriously all of my images are returning 500’s and displaying that god-forsaken question mark image. I haven’t changed anything in the components with the images in them, nor have I changed the directory structure. Everything works locally. But deployed - it’s not. I can’t figure this out
I'm doing direct import of the images like so:
And using them like:
As I say, they've never had issues until today. Wondering if a recent change in next caused this, as I'm using
Curiously, the request URL is:
I would have expected /'s instead of %2F
Finally, the response from the request is:
Today I deployed a new build and mysteriously all of my images are returning 500’s and displaying that god-forsaken question mark image. I haven’t changed anything in the components with the images in them, nor have I changed the directory structure. Everything works locally. But deployed - it’s not. I can’t figure this out
I'm doing direct import of the images like so:
import PooImage from '../public/pooImage.png'And using them like:
<Image src={PooImage} sx={{ someStyles }} alt="PooImage"/>As I say, they've never had issues until today. Wondering if a recent change in next caused this, as I'm using
latest in my package.jsonCuriously, the request URL is:
https://<somedomain>/_next_image?url=%2F_next%2Fmedia%2FpooImage.pngI would have expected /'s instead of %2F
Finally, the response from the request is:
"url" parameter is valid but upstream response is invalidAnswered by Broad-snouted Caiman
Tbh I would try downgrading to
next: 13.4.12 and see if that fixes it. I've personally had a LOT of problems with 13.4.15 and I wouldn't doubt that this could be related. Also, I would use latest with caution. That can really be a footgun, especially when dependencies like Next have major updates like 13.4.x .8 Replies
Broad-snouted Caiman
Tbh I would try downgrading to
next: 13.4.12 and see if that fixes it. I've personally had a LOT of problems with 13.4.15 and I wouldn't doubt that this could be related. Also, I would use latest with caution. That can really be a footgun, especially when dependencies like Next have major updates like 13.4.x .Answer
Polar bearOP
I'll give it a whirl
Say a prayer or 12 for me
Polar bearOP
That resolved it
Broad-snouted Caiman
@Polar bear any time
Giant panda
Hello. I have a similar issue. but my version of Next is 13.5.4 and it's just happening with some (not all) images inside /assets directory. the only difference is that the images with the problem are nested inside other directories (for organization purposes). however in localhost they work as expected but not when the application is deployed to the staging environment