Infinite building time when deploying on Vercel
Hi, I have been working on a website using Nuxt a year ago and now I tried updating the Vercel build with the rewrite I've done throught the year but sadly after building the nitro server, it stuck with no error. I tested node version 18.x and 20.x. Adding the Vercel Edge function to the build command made an error. The project is now on Nuxt 3.11. and idk what to do honestly without an explicit error code:
The full build log is below
9 Replies
Update: After 45 minutes the build failed
(without additions to the build log btw)
So nothing happens
Vercel asks you to buy a subscription to have support
Have you tried nuxi build with the vercel preset locally to see if it does something similar? What’s your vercel build settings.
I have done some reseach and it appears that defining a custom nitro plugin totally broke the building process
This plugin has the goal of initialising Mongodb globally as to not spam / initialize a different connection at every moment the server needs to made an request
the ~/server/index.ts
Is this trying to run on an edge function in vercel? Long running connections might not be a solution for serverless.
No it's a "normal" build
Using edge function is a solution or I really have to instanciate a new mongodb connection everytime there's an request ?
New connection per request with serverless products like vercel functions.