Nextjs 13 and Image
Hello team,
i wonder does railways support the new version of Nextjs ?
Im facing this error : ```"url" parameter is valid but upstream response is invalid"
28 Replies
Project ID:
N/A
we will need more context than that
Ok my bad, what should i provide for people to understand my issues ?
lets start with full error logs
upstream response is invalidwell what are you trying to call?
Im trying to display image with the last version of nextjs (Nextjs13)the with <Image src={} alt=""/>
so to answer the question, railway supports almost anything, as long as you code it correctly
are you using a custom domain?
No i'm using the free Plan planning to deploy a client app on it and want to test it
I got a auto generate domain name by Railways
End with : githubname-production.up.railway.app
can you give me the full link to the image in question?
Yes here : https://lulav2-production.up.railway.app/_next/image?url=%2F_next%2Fstatic%2Fmedia%2FgrazianiSansFond.75b9ed18.png&w=1200&q=75
And it's for all the image in the website
looks like this is just a code issue and not isolated to railway, please do some research on this topic
Ok will do, thx for your time Brody !
For people passing by After a few hours of debugging, I've come to the conclusion that railways doesn't support the latest version of nextjs 13.5.
Nextjs Image tag is problematic
I'll try with a pro plan to see if it's not the free plan that can cause problems.
hold on there
that is not the case
please check this message
this issue is not limited to railway and its really not related to your plan type
Maybe is the Free plan because when im using a TCP connection image are showing, ( forgot to try this )
So basically, the error is from HTTP/HTTPS so the problem is from the server redirecting in https but only serve image from http
right, this not an issue with railway or your plan, this is a code issue
Gonna check for an htaccess if that so
that has nothing to do with it
railway and your code do not use .htaccess
nextjs13 has introduced various new things, also do the documents advise you to use Next/Image and display the image as a component
that way you're not fetching a url either to get your img
Yep :
Already do that for all my img
haha youre amazing!
Im noob but still i know my basics 😂
why dont you call the image from your public folder?
instead of a url
import LogoGaziani from "../../../public/grazianiSansFond.png";
Already call it from public
I see
does it display local?
Yep display on local , on vercel also but on railways only in http not in https trying to figure why tho
Ok working now, just dont use the Image tag from nextjs or add
images: {
unoptimized: true,
},
Or if really needed stay on vercel
ps : It was an issue with Railways not supporting image optimizer from Next not an code error
I see
Yeah the thing is its impossible to compete with Vercel with NextJs
It's theirs
Created an issue to track this internally. We should definitely support this!
Just a little update with remote Image, even if you not have
It work so it seem to be just on static image