Category: Vercel and hosting

Vercel Function Times Out While Waiting for an External API

Read this guide in Polish

The server function returns the timeout when waiting for the supplier's response instead of doing business logic. The waiting time for an external request may use the entire budget for the performance of the function.

How to determine the source of the error

From logs read the request duration and set which integration corresponds to the slowest.

Check whether timeout is for Vercel, fetch to the supplier or connection to the base.

What to do step by step

1. Add your own AbortSignal.timeout for external calls and handle the limit clearly.

2 . The longer tasks separate from the short HTTP response by queue and retra mechanism, if the process allows.

How to check the score

Overshooting external time API gives a controlled error, and simple requests do not exceed the limit.

What to do

Do not extend one customer request without end if the operation should act asynchronously.