#Task timed out after 10.02 seconds

21 messages · Page 1 of 1 (latest)

jagged grail
#

I'm encountering a persistent issue with my Next.js application deployed on Vercel. During certain operations, particularly when handling user sign-ups, I'm getting a timeout error: "Task timed out after 10.02 seconds". This happens intermittently and seems to occur during serverless function execution.
Framework: Next.js
Deployment: Vercel
Database: Supabase

Any insights or suggestions to fix this would be greatly appreciated!

limpid jettyBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

earnest anchor
#

@jagged grail
To resolve the timeout issue in your Next.js application on Vercel, consider optimizing your serverless functions to complete within the time limit by breaking down heavy tasks or moving long-running processes to background jobs. Additionally, ensure your Supabase queries are optimized and not causing delays. If necessary, increase the timeout settings in Vercel's serverless function configuration.

tranquil jetty
#

yeah idk how much data is involved in a signup but it honestly should't be taking 10 seconds

#

I would indeed look into what queries etc you're running

jagged grail
#

well this is relly strange, because my calls are not taking 10 s -> and all the calls are 200 statuss

tranquil jetty
#

but yes if needed you can increase the timeout, they recently raised the limit for the free tier to I think 60 seconds

jagged grail
#

How can i do this? Vercel's serverless function configuration.?

tranquil jetty
#

ooh it doesn't take that long consistently?

#

I'm not sure if there's a global setting but you can export a variable like this

export const maxDuration = 60;

#

with that being the time in seconds

jagged grail
#

so basically i should add this "export const maxDuration = 60;" to all my routes

tranquil jetty
#

you can also add global ones or do pattern matching, look at the link

#

but again I would look into what is causing it to take that long in the first place

#

cause that's not normal for a user signing up

#

are there many "round trips' between supabase and your server in the sign up process?

#

Are they hosted in the same region?

jagged grail
#

same region, is strange, because it was working before- like even reverted to an older commit and it throws same error

tranquil jetty
#

how long has this been happening?

#

also check your Supabase dashboard for logs etc