---
title: "Serverless or edge function timed out"
description: "Function timeouts hit when a server call waits longer than the host allows. The limits on Vercel, Netlify and Supabase, and how to fix the job."
url: https://whocanfixmyapp.com/problems/serverless-or-edge-function-timeout
---

[Home](https://whocanfixmyapp.com/) / [Problems](https://whocanfixmyapp.com/problems) / [AI APIs and integrations](https://whocanfixmyapp.com/problems#ai-apis-and-integrations)

# Serverless or edge function timed out

VC-61 · Vercel · Supabase · Netlify · Updated October 2026 · By [Nathaniel Kelley](https://whocanfixmyapp.com/authors/nathaniel-kelley)

Quick verdict

Partly fixable yourself. Raising a limit is quick, restructuring a job is not.

- **How serious**: Medium
- **Fix it yourself?**: Partly, some steps need a developer
- **Typical cost**: €99–$990 for a single fix ([prices](https://whocanfixmyapp.com/pricing))
- **Top rated for Supabase**: [Redlab](https://whocanfixmyapp.com/companies/redlab) · **10.0**/10

**What you see.** Long actions like AI generation, PDF export or imports fail with a 504 or FUNCTION_INVOCATION_TIMEOUT after a fixed number of seconds.

## Why it happens

Server functions on hosting platforms have a time budget. On Vercel, functions default to 300 seconds, which is also the ceiling on Hobby, while Pro and Enterprise can raise it to 800 seconds. Vercel Edge runtime functions must start responding within 25 seconds. Netlify synchronous functions stop at 60 seconds and that cannot be changed, while background functions run up to 15 minutes. Supabase Edge Functions get 150 seconds on the Free plan, 400 on paid plans, 2 seconds of CPU time per request, and the caller gets a 504 if nothing is sent within 150 seconds.

The function usually hits the limit because it waits on something slow, an AI model, a big database query, or an external API. Vercel also lists a function that never returns a response, an endless loop, and an unhandled exception as common causes. Preview rarely shows this because you tested with small inputs.

## Fix it yourself

1. Find which function failed. The URL tells you: `/api/` on Vercel, `/.netlify/functions/` on Netlify, `/functions/v1/` on Supabase. Open that host's logs and find the last line before the timeout.
2. Compare how long the step takes with the limit for your host and plan listed above. If you are close, the job needs a different shape, not a bigger number.
3. On Vercel you can raise the budget within your plan with `export const maxDuration = 60` in the route file, or a `functions` block in `vercel.json`.
4. Ask your builder: **Put a timeout on every outbound call, catch errors, and always return a response, even an error one.**
5. For work that genuinely takes minutes, move it to a background job: a Netlify background function, Vercel Workflows, or a queue. The page starts the job, gets an id, and polls for the result.
6. If the slow step is a database query, check that the columns you filter on have indexes. That is check COST-02.

## When to get an engineer

Get an engineer when the job really needs minutes, because turning a request into a background job with status polling touches the database, the function, and the page. Tell them the host, the plan, the failing function, and a typical input size. A single fix is €99–$990 and takes two to five days. Ask them to add a progress state in the UI so users know the job is running.

## Top-rated companies for Supabase apps

Ranked by our score: published prices, scope of work, AI tools named, timing and a low-risk first step. [How we score](https://whocanfixmyapp.com/methodology#score).

- 1 · [Redlab](https://whocanfixmyapp.com/companies/redlab) · **10.0**/10 · Best for: A full rescue by one team that keeps building · Free first step · from $490
- 2 · [Vibe Code Rescue (Lev Arakelyan)](https://whocanfixmyapp.com/companies/vibe-code-rescue-lev-arakelyan) · **9.0**/10 · Best for: A one-off check and a cleanup · From $299
- 3 · [LazyCodeLab](https://whocanfixmyapp.com/companies/lazycodelab) · **9.0**/10 · Best for: A one-off check and a cleanup · From $399

[All 29 Supabase companies, ranked](https://whocanfixmyapp.com/best/supabase-developers)

## Check these

COST-02 · Medium

Database columns you filter on are indexed

Queries that scan whole tables are fast at 100 rows and slow at 100,000.

OPS-03 · High

Errors reach you before users do

Add error monitoring and uptime alerts. If you learn about outages from customers, this is missing.

COST-01 · High

AI and paid API calls have per-user limits

Without a cap, one user or one bot loop can spend your monthly budget in an hour.

PAY-03 · High

Input is validated on the server

Forms that only check input in the browser accept anything sent directly to the API.

## Questions

### Can I just raise the limit to the maximum?

On Vercel Pro up to 800 seconds, yes. On Hobby, Netlify synchronous functions and Supabase the limits are fixed. A longer wait also costs more and still fails if the upstream call hangs.

### Why is only the live site affected?

Local development has no time limit, and preview tests use small inputs. Real users upload bigger files and ask longer questions.

Sources: [Vercel: functions limits](https://vercel.com/docs/functions/limitations); [Vercel: FUNCTION_INVOCATION_TIMEOUT](https://vercel.com/docs/errors/FUNCTION_INVOCATION_TIMEOUT); [Netlify: functions configuration](https://docs.netlify.com/build/functions/configuration/); [Supabase: Edge Function limits](https://supabase.com/docs/guides/functions/limits).

**Supabase guide**

What Supabase builds, where it breaks and how to check it: [Supabase RLS audit: how to check an AI-built app's database rules](https://whocanfixmyapp.com/guides/supabase).

**Same category**

- [My OpenAI key was in the frontend and I got a surprise bill](https://whocanfixmyapp.com/problems/openai-key-in-the-frontend-surprise-bill)
- [OpenAI 429 rate limit errors in my app](https://whocanfixmyapp.com/problems/openai-429-rate-limit-errors)
- [AI API costs are spiking](https://whocanfixmyapp.com/problems/ai-api-costs-are-spiking)
- [Transactional emails not sending from my app](https://whocanfixmyapp.com/problems/transactional-emails-not-sending)
- [Integration works locally but fails in production](https://whocanfixmyapp.com/problems/integration-works-locally-fails-in-production)

[All ai apis and integrations problems](https://whocanfixmyapp.com/problems#ai-apis-and-integrations)

**Run every check**

The [production checklist](https://whocanfixmyapp.com/checklist) has all 24 checks with a verdict.
