Short answer
Check the function ends: return the promise in event functions and send a response in HTTP functions. If the work is slow, raise timeoutSeconds within the limit for its type. For callable functions over 70 seconds, raise the client timeout too. Move long jobs to a task queue.
Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.
Why the function times out, and the fix
01
The function never signals that it finished
“Terminate HTTP functions with res.redirect(), res.send(), or res.end().” Firebase, Sync, async, and promises
An event function that doesn’t return its promise, or an HTTP function that never sends a response, runs until the timeout. Return the promise, and end every path with res.send() or res.end().
02
The work is slower than the timeout
“HTTP and callable functions: 3600 seconds (60 minutes) Scheduled/Task queue functions: 1800 seconds (30 minutes) Other event-driven functions: 540 seconds (9 minutes)” Firebase, Manage functions (Set timeout and memory allocation)
AI calls, file processing and large exports can take minutes. Raise timeoutSeconds within the maximum for its type. The sample is 2nd gen; on 1st gen use runWith({ timeoutSeconds: 540 }) at most.
const { onRequest } = require('firebase-functions/v2/https'); exports.report = onRequest({ timeoutSeconds: 300, memory: '1GiB' }, async (req, res) => { const data = await buildReport(); res.json(data); });03
The callable client gives up first
“For HTTP callable functions, the client SDKs enforce a separate default request timeout of 70 seconds (or 60 seconds on Flutter).” Firebase, Manage functions
The client SDKs stop waiting after 70 seconds, or 60 on Flutter, even when the server timeout is longer. The app then shows deadline-exceeded. Set the client timeout to match, for example httpsCallable(functions, name, { timeout: 300000 }) on the web.
04
An outside API hangs
A fetch with no timeout waits as long as the function lets it. Give outside calls their own timeout, catch the error, and return a clear message instead of hanging.
Checked against the vendor’s docs on : Firebase docs: Manage functions; Firebase docs: Quotas and limits; Firebase docs: Sync, async, and promises.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Firebase Functions memory limit exceeded · Firebase Functions 403 Forbidden · Firebase Functions deploy failed · Firebase callable INTERNAL error