Error when building to Vercel (it doesn't specify what's the problem)
Answered
Nebelung posted this in #help-forum
NebelungOP
It's the first time I don't understand the Vercel build error. It was all working fine and suddenly I only change the Image "sizes" property and it breaks the builds. What do they mean? Can someone help me?
Answered by Nebelung
I heard back from the support. For anyone running into the same issue the issue was related to an update in the Vercel CLI version from 41.1.3 to 41.2.2. Adding the
VERCEL_CLI_VERSION=vercel@41.1.3
environment variable to force the use of version 41.1.3 and then redeploying helped.18 Replies
California Gull
Maybe you are using <Img> component.
When you are using Img, have to set width and height value.
NebelungOP
What do you mean? I'm not using "Img" component. only nextjs "Image"
California Gull
I mean Image tag.
NebelungOP
I have no problems building locally. the Image component is not a problem I think.
California Gull
If you use html tag img, you don't need to set width, height value
NebelungOP
I'm not using html tag img in my project.
California Gull
But If you are using Next Image tag, you have to set width and height value.
when html img: <img src ="skkej" alt= " " />
when Next Image: <Image src="ksjef" width="400" height="300" alt="skjef" />
like above.
NebelungOP
I have width and height on all Image components. These sort of problems would appear in the local build, which is working fine. I suddenly can't build to Vercel, that's the problem.
California Gull
Did you run npm run build on local?
NebelungOP
yes. zero warnings or errors. I can see in Deployments for my project that the last working build was actually "redeployed" in vercel dashboard. is it possible that is the problem?
NebelungOP
It's completely broken. I can't even redeploy the latest successful deployment. What I've tried:
1. made sure the Node versions match in Vercel and locally,
2. running pnpm run build locally (it works) before pushing to Vercel,
* redeploying the latest successful deployment.
From what I remember the latest successful deployment that was a redeployment that I did after changing NEXT_PUBLIC_URL env variable from .vercel.app to my domain.
1. made sure the Node versions match in Vercel and locally,
2. running pnpm run build locally (it works) before pushing to Vercel,
* redeploying the latest successful deployment.
From what I remember the latest successful deployment that was a redeployment that I did after changing NEXT_PUBLIC_URL env variable from .vercel.app to my domain.
NebelungOP
Full build logs text file from Vercel
NebelungOP
I texted the Vercel support but if someone could look into it that would be great. i'm currently unable to built at all to production.
NebelungOP
I heard back from the support. For anyone running into the same issue the issue was related to an update in the Vercel CLI version from 41.1.3 to 41.2.2. Adding the
VERCEL_CLI_VERSION=vercel@41.1.3
environment variable to force the use of version 41.1.3 and then redeploying helped.Answer