R
Railway•15mo ago
Tyron

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
Percy
Percy•15mo ago
Project ID: N/A
Brody
Brody•15mo ago
we will need more context than that
Tyron
TyronOP•15mo ago
Ok my bad, what should i provide for people to understand my issues ?
Brody
Brody•15mo ago
lets start with full error logs
upstream response is invalid
well what are you trying to call?
Tyron
TyronOP•15mo ago
No description
Tyron
TyronOP•15mo ago
Im trying to display image with the last version of nextjs (Nextjs13)the with <Image src={} alt=""/>
Brody
Brody•15mo ago
so to answer the question, railway supports almost anything, as long as you code it correctly are you using a custom domain?
Tyron
TyronOP•15mo ago
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
Brody
Brody•15mo ago
can you give me the full link to the image in question?
Brody
Brody•15mo ago
looks like this is just a code issue and not isolated to railway, please do some research on this topic
Tyron
TyronOP•15mo ago
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.
Brody
Brody•15mo ago
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
Tyron
TyronOP•15mo ago
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
Brody
Brody•15mo ago
right, this not an issue with railway or your plan, this is a code issue
Tyron
TyronOP•15mo ago
Gonna check for an htaccess if that so
Brody
Brody•15mo ago
that has nothing to do with it railway and your code do not use .htaccess
Floris
Floris•15mo ago
nextjs13 has introduced various new things, also do the documents advise you to use Next/Image and display the image as a component
< ImgToDisplay />
< ImgToDisplay />
that way you're not fetching a url either to get your img
Tyron
TyronOP•15mo ago
Yep :
<Image
src={LogoGaziani}
alt="logo"
fill
sizes="(max-width: 768px) 50%, (max-width: 1200px) 50%, 75%"
priority
/>
<Image
src={LogoGaziani}
alt="logo"
fill
sizes="(max-width: 768px) 50%, (max-width: 1200px) 50%, 75%"
priority
/>
Already do that for all my img
Floris
Floris•15mo ago
haha youre amazing!
Tyron
TyronOP•15mo ago
Im noob but still i know my basics 😂
Floris
Floris•15mo ago
why dont you call the image from your public folder? instead of a url
Tyron
TyronOP•15mo ago
import LogoGaziani from "../../../public/grazianiSansFond.png"; Already call it from public
Floris
Floris•15mo ago
I see does it display local?
Tyron
TyronOP•15mo ago
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
Floris
Floris•15mo ago
I see Yeah the thing is its impossible to compete with Vercel with NextJs It's theirs
jr
jr•15mo ago
Created an issue to track this internally. We should definitely support this!
Tyron
TyronOP•15mo ago
Just a little update with remote Image, even if you not have
images: {
unoptimized: true,
},
images: {
unoptimized: true,
},
It work so it seem to be just on static image
Want results from more Discord servers?
Add your server