How to increase function timeout on local environment

How do i increase my netlify function timeout on local test environment, which is netlify dev, o tried this on netlify .toml:
functions_timeout = 25

This is from AI chatGPT, but it didn’t help, bard AI did not help.

I know increasing function timeout is for pro plan, but its my netlify dev on my localhost.

Is it ok to edit the netlify files from node_modules?

CLI will automatically use the upgraded time-limit if you’ve linked it to your Netlify site using netlify link. But your Netlify site should have the upgraded timeout for that to work.

Feel free to edit node_modules if you wish.

I hope editing node_modules won’t be causing some error

Hi @hrishikesh,

You have previously upgraded the timeout on my site, gv-dashboard… but in local dev mode, the timeout is still 10 seconds.

I know I can edit the node_modules, but I’d rather get it configured correctly and not lose this setting during my next update of the package.

What can I do to fix/investigate this?

Same thing that I have mentioned above: netlify link.

Hi. I am facing the same issues here. We got the timeout of our site extended by support request to the maximum possible (somewhere around 20 something seconds) but the local netlify dev times out after then seconds. I already did a netlify unlink & link (netlify-cli/17.14.0) but that didn’t help either.

Have you linked it to the same site that got the upgraded limit?

yes I did. It only times out when on local dev … works perfectly fine when I run the netlify hosted endpoint (without timeout).

Hi @andreass,

There is a workaround for this. If you look at the codebase for the CLI you’ll see this: cli/src/utils/dev.ts at main · netlify/cli · GitHub


The functions timeout is set in the CLI code. In order to modify it, you’ll need to navigate to where your local copy of the CLI is stored and edit that line in that file. If you change the value to 26, that should then cause the CLI to use the longer timeout.

One caveat here is that setting is not going to persist if/when you upgrade the CLI to a new version. If you upgrade the CLI, you’ll need to make that same change again.

We have submitted a feature request to see about making this configurable or inherit the value from a linked site. If you want to follow along, you can find that here: Make function timeout editable OR inherit from linked site · Issue #6125 · netlify/cli · GitHub

Hi, Yes I know of the workaround and that’s what I/we are using right now. But I would rather prefer to not use a “hack” to get this working. Good to know that there is a feature request pending that addresses this!