Support Forums

Background function timeout locally


I’m developing a background function to automate a task.
I renamed my file from “function.ts” to “function-background.ts”. However, my function still timeout after 10sec when run locally.

The error is:
TimeoutError: Task timed out after 10.00 seconds

It didn’t push it to production yet.
I just wanted to know if it’s normal behavior and if there is a workaround to execute background functions locally for more than 10sec.

Thx for your help and your time.

HI @nilscam

There is a (now closed) issue Support for Background Functions · Issue #2697 · netlify/cli · GitHub which was apparently fixed in pull #2704.

Hey coelmay,
thanks for your answer,

The thing is that my background is triggered fine but during execution, it always timeout after 10sec.

Just to check @nilscam that you’re on the Pro or higher plan as they aren’t available on the Starter?

Here is the timeout config in Netlify CLI. It would seem your functions are not being called as background functions.

I wonder if you try running dev in offline mode netlify dev -o if that changes things.