Deployment of Next.js app on Vercel failed and no error messages
Unanswered
Cuban Crocodile posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
I am currently using the pages directory in Next.js
I have tried both Node 18 and Node 20, btw another identical project (same code for test environment) can build successfully and quickly. (API issues have been ruled out)
14.1.0
, and our app is deployed on Vercel. Since yesterday, the deployment duration has increased from the previous 5 mins to 45+ mins, and most of the deployments are failing. No error messages are visible. 🤔I have tried both Node 18 and Node 20, btw another identical project (same code for test environment) can build successfully and quickly. (API issues have been ruled out)
35 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
During the slow build at around 70%, it suddenly terminates and indicates build failure with no visible error messages ðŸ§
![Image](https://cdn.discordapp.com/attachments/1198119463594238043/1198120658983473172/image.png?ex=65bdbfd1&is=65ab4ad1&hm=03644aee217def581db7919c0eb925500358c42babfcd04d3b879840e9225aea&)
![Image](https://cdn.discordapp.com/attachments/1198119463594238043/1198120659478388846/image.png?ex=65bdbfd1&is=65ab4ad1&hm=d2e8d2e448b940df82e6d36f6bd6bb706978c75f86024a0cc3005c8c3980b967&)
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
why are you generating 963 pages
that's why your build is slow
back in 14.0.x, what was the number of statically generated pages?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
The 963 pages include some pre-generated news pages (multi-languages), as you can see in the screenshot, if the build goes smoothly it can be completed within 5-6 mins
![Image](https://cdn.discordapp.com/attachments/1198119463594238043/1198135045953695784/image.png?ex=65bdcd37&is=65ab5837&hm=fafb45367801306fd59b2651583c6d7209aa42c58ab2f497234b9c5d0bcb92a6&)
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
so in 14.0.x you still generated near 1k pages? interesting, never seen 1k pages being generated that fast before
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
the minimum requirement in the project is Node 18 or above, but I think this issue is not related to the Node version 🤔
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
i meant next@14.0.x, not node@14.0.x
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
we have another vercel project with the same codebase, and the build is going smoothly
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
since you says it went wrong from 14.1.0, im asking if it was the same number before 14.1.0
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
oh sorry, got you point. but can't cannot explain this one
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
honestly i don't know either. now 1k pages is a gigantic number and typically you don't want to generate that many; you may want to use [dynamicParams: true](https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) to generate less important pages on-demand instead. but it's not relevant to the next version or why it works elsewhere but not here – about this part i don't have any ideas either
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
We have tens of thousands of news articles, and currently, we have pre-generatea few hundred of them, and the rest will be generated on-demand based on ISR.
Since these news articles receive high traffic, we want them to be static and pre-generate so that they can respond as quickly as possible when the links are clicked
Since these news articles receive high traffic, we want them to be static and pre-generate so that they can respond as quickly as possible when the links are clicked
btw we are using
pages
dir at the moment![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
oh didnt notice this, sorry
ok now this is something really strange and idk why it happens either
maybe try typical steps like rebuilding without cache
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
this is the result of another vercel project under the same codebase, just deployed, the additional 2-3 mins are because the server we use for testing is not as robust as the prod env
![Image](https://cdn.discordapp.com/attachments/1198119463594238043/1198139819931467857/image.png?ex=65bdd1a9&is=65ab5ca9&hm=8b135019b4076615379f75c6d684b631996a4a28a322eb899739e3a42ca39db4&)
tried many times, but no luck 🥹
strangely after the build failure, there is no error message visible 👀
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
yes the only error message is at the top saying you hit the 45 min time limit
let's try this. rerun a failed build, and see how long on average does each page generation take
and do it for the successful build as well
you can try
console.time
and console.timeEnd
to also log that time duration![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
Hit the limit again in the prod env and in the build logs, we can roughly calculate that in the case of failure, each page takes an average of 26 sec
![Image](https://cdn.discordapp.com/attachments/1198119463594238043/1198142876517937263/image.png?ex=65bdd482&is=65ab5f82&hm=e9d689c927c737d8e05325f163df989b2b8f8960c90a6572e011c5f04843eb7c&)
but in the same prod env (2 days ago), each page took only around 0.5 sec
from this screenshot, we can see the build duration from the past few days
there is a huge diff in duration 🤔 we have also checked the API service and found no issues, no rete limit
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
when building locally, how much does it take on avg?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
Let me give it a try, there might be a diff depending on the machine performance
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
each page takes an avg of 0.8 sec locally
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
ok now that is really strange. can you try making a new vercel project and deploying on there, does that fix it?
if not probably time to contact vercel support
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
yeah, I think it's time to get in touch with vercel, thank your for your help 🫡 ðŸ™
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuban CrocodileOP
Fixed, a slow build and subsequent timeout occurred due to the unexpected suspension of an asyn task