Short answer
The function crashed while handling the request. Open the deployment’s Logs tab and find the error from the failing request. Typical causes are an error your code didn’t catch, or a setting such as an environment variable that’s missing in production. Fix that, wrap the handler in try/catch so it returns a real error response, and redeploy.
What makes the function fail, and the fix
01
An error nothing caught
“Node.js or Bun threw an unhandled rejection/uncaught exception.” Vercel, FUNCTION_INVOCATION_FAILED
An exception or a rejected promise that nothing handles stops the function, and Vercel answers with this 500. The stack trace is under the Logs tab. Catch errors in the handler and return a response with a clear status, and await every promise so a rejection lands in your try/catch.
02
A setting the function needs is missing
“Double-check the function configuration to ensure that it's set up correctly, including any environment variables or other settings” Vercel, FUNCTION_INVOCATION_FAILED
Vercel’s checklist includes verifying the function’s configuration and environment variables. Code that reads an API key or database URL fails when that variable isn’t set for Production. Variables are set per environment, and a change only applies to new deployments, so check the variable and then redeploy.
03
The runtime itself crashed
“The runtime process (Node.js, Bun, Python, etc.) has crashed.” Vercel, FUNCTION_INVOCATION_FAILED
Sometimes the process running your code stops, not just the request. Vercel says to check the code for errors and infinite loops.
Checked against the vendor’s docs on : Vercel docs: FUNCTION_INVOCATION_FAILED; Vercel docs: Environment variables.
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.See scope and start
Related: Vercel function timeout (504) · Vercel env variables undefined · Vercel Module not found · Vercel 413 payload too large