Build fails at Deploying outputs...
Answered
Chestnut-sided Warbler posted this in #help-forum
Chestnut-sided WarblerOP
Recently upgraded to nextjs 16 and cache components. Locally I can build my project without any errors and use it with pnpm start.
But when trying to get a build from vercel i get the below output
-Tasks: 1 successful, 1 total
-Cached: 0 cached, 1 total
-Time: 4m5.212s
-Summary: /vercel/path0/.turbo/runs/34pACcXb9UmlvCMvDsCjqJ1SqVA.json
-Next.js server files in: 56.544ms
-Created all serverless functions in: 536.715ms
-Collected static files (public/, static/, .next/static): 14.622ms
-Build Completed in /vercel/output [5m]
-Deploying outputs...
-An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact Vercel Support https://vercel.com/help
But when trying to get a build from vercel i get the below output
-Tasks: 1 successful, 1 total
-Cached: 0 cached, 1 total
-Time: 4m5.212s
-Summary: /vercel/path0/.turbo/runs/34pACcXb9UmlvCMvDsCjqJ1SqVA.json
-Next.js server files in: 56.544ms
-Created all serverless functions in: 536.715ms
-Collected static files (public/, static/, .next/static): 14.622ms
-Build Completed in /vercel/output [5m]
-Deploying outputs...
-An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact Vercel Support https://vercel.com/help
Answered by Chestnut-sided Warbler
Okay so this is the answer from the vercel support:
Our internal logs show that build failures are due to large metadata. Since you're using PPR, and we've seen similar issues with other customers, can you please try setting the environment variable VERCEL_ENABLE_EXTENDED_FALLBACK_PAYLOAD=1 and then attempt the build again?
Additionally, the build logs show you have a large route, which will also contribute to the metadata issue. If the issue persists after adding the above variable, could you please try using a shorter name for it and try again? /en/product/xxxxxxxxxxxxx-xxxxxxxxxxxx-xxx-xxx I look forward to your response. Feel free to let me know if you have any other queries or concerns. I am happy to help.
And here is what i did:
1-I've added the env variable and redeployed. But it did not work
2-I've removed the generateStaticParams block from the product/[slug]/page.tsx. And it successfully deployed
TLDR: Removing generateStaticParams solved my issue but now my pages are not statically generated at build time
Our internal logs show that build failures are due to large metadata. Since you're using PPR, and we've seen similar issues with other customers, can you please try setting the environment variable VERCEL_ENABLE_EXTENDED_FALLBACK_PAYLOAD=1 and then attempt the build again?
Additionally, the build logs show you have a large route, which will also contribute to the metadata issue. If the issue persists after adding the above variable, could you please try using a shorter name for it and try again? /en/product/xxxxxxxxxxxxx-xxxxxxxxxxxx-xxx-xxx I look forward to your response. Feel free to let me know if you have any other queries or concerns. I am happy to help.
And here is what i did:
1-I've added the env variable and redeployed. But it did not work
2-I've removed the generateStaticParams block from the product/[slug]/page.tsx. And it successfully deployed
TLDR: Removing generateStaticParams solved my issue but now my pages are not statically generated at build time
17 Replies
@Chestnut-sided Warbler Recently upgraded to nextjs 16 and cache components. Locally I can build my project without any errors and use it with pnpm start.
But when trying to get a build from vercel i get the below output
-Tasks: 1 successful, 1 total
-Cached: 0 cached, 1 total
-Time: 4m5.212s
-Summary: /vercel/path0/.turbo/runs/34pACcXb9UmlvCMvDsCjqJ1SqVA.json
-Next.js server files in: 56.544ms
-Created all serverless functions in: 536.715ms
-Collected static files (public/, static/, .next/static): 14.622ms
-Build Completed in /vercel/output [5m]
-Deploying outputs...
-An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact Vercel Support https://vercel.com/help
have you tried contacting vercel support? as you may know this server doesn't have vercel support (unless someone happen to have the same issues)
Chestnut-sided WarblerOP
Okay so this is the answer from the vercel support:
Our internal logs show that build failures are due to large metadata. Since you're using PPR, and we've seen similar issues with other customers, can you please try setting the environment variable VERCEL_ENABLE_EXTENDED_FALLBACK_PAYLOAD=1 and then attempt the build again?
Additionally, the build logs show you have a large route, which will also contribute to the metadata issue. If the issue persists after adding the above variable, could you please try using a shorter name for it and try again? /en/product/xxxxxxxxxxxxx-xxxxxxxxxxxx-xxx-xxx I look forward to your response. Feel free to let me know if you have any other queries or concerns. I am happy to help.
And here is what i did:
1-I've added the env variable and redeployed. But it did not work
2-I've removed the generateStaticParams block from the product/[slug]/page.tsx. And it successfully deployed
TLDR: Removing generateStaticParams solved my issue but now my pages are not statically generated at build time
Our internal logs show that build failures are due to large metadata. Since you're using PPR, and we've seen similar issues with other customers, can you please try setting the environment variable VERCEL_ENABLE_EXTENDED_FALLBACK_PAYLOAD=1 and then attempt the build again?
Additionally, the build logs show you have a large route, which will also contribute to the metadata issue. If the issue persists after adding the above variable, could you please try using a shorter name for it and try again? /en/product/xxxxxxxxxxxxx-xxxxxxxxxxxx-xxx-xxx I look forward to your response. Feel free to let me know if you have any other queries or concerns. I am happy to help.
And here is what i did:
1-I've added the env variable and redeployed. But it did not work
2-I've removed the generateStaticParams block from the product/[slug]/page.tsx. And it successfully deployed
TLDR: Removing generateStaticParams solved my issue but now my pages are not statically generated at build time
Answer
Boerboel
So what seems to be the issue?
Just that there is large number of routes? How many routes has been created in your sitemap
Chestnut-sided WarblerOP
there are 400 pages to be statically generated.And I don't know why the name of the route is important here
@Chestnut-sided Warbler there are 400 pages to be statically generated.And I don't know why the name of the route is important here
same, seems like an oversight from the vercel platform itself
regardless, it should be fine if the site isn't generated at build time? it would be generated request-time but it will be cached statically
@alfonsüs ardani regardless, it should be fine if the site isn't generated at build time? it would be generated request-time but it will be cached statically
Chestnut-sided WarblerOP
Yes, I think so too, but do you know a way for me to test that if the caches properly working or not?
@Chestnut-sided Warbler Yes, I think so too, but do you know a way for me to test that if the caches properly working or not?
yes, just visit an ungenerated route and it should take few seconds at first but instantly in consecutive refresh
even if you use "disable cache" in devtool or hard refresh
Chestnut-sided WarblerOP
Yes that makes sense, I was actually curious about if there was any tool for that like how you can see Memo besides the element in a tree in the react dev tools extension but for the pages of your app
Chestnut-sided WarblerOP
Yep, I'm aware. I was actually thinking something like the diagram in the docs. A somewhat visual or even a tree like view that we can see the static and dynamic parts of the page would be cool. I don't know if it's feasible/achievable tough. Do you think something like this make it easier or is it unnecessary? I will give it a go when I have the time.
@Chestnut-sided Warbler Yep, I'm aware. I was actually thinking something like the diagram in the docs. A somewhat visual or even a tree like view that we can see the static and dynamic parts of the page would be cool. I don't know if it's feasible/achievable tough. Do you think something like this make it easier or is it unnecessary? I will give it a go when I have the time.
it would but its a QoL atm, if you see NextConf, some of the presenter has this fancy setup where it can show those boundaries. might want to check it out on your free time 👀
Chestnut-sided WarblerOP
You're great, thanks for the help and resources