Skip to content
5 min read

Application Error Codes

This section focuses on errors that can happen at the level of your application when you interact with Vercel.

The requested Serverless Function from the application did not return a string as the body.

This is an error with the application.


502: Bad Gateway
Code: BODY_NOT_A_STRING_FROM_FUNCTION
  • Check the application logs, which can be found at the host URL under the /_logs path, for example:
    logs-url
    https://my-deployment-my-username.vercel.app/_logs
  • Check if the application is returning an empty response, or possibly null.

The request for a Edge Function was not completed successfully. This is an application error.


500: Internal Server Error
Code: EDGE_FUNCTION_INVOCATION_FAILED
  • A common cause for this issue is when the application contains an unhandled exception. Check the application logs, which can be found at the host URL under the /_logs path, for example:
    logs-url
    https://my-deployment-my-username.vercel.app/_logs

The maximum duration for an Edge Function execution is 25 seconds, otherwise the request will time out. This is an application error.


504: Gateway Timeout
Code: EDGE_FUNCTION_INVOCATION_TIMEOUT
  • A common cause for this issue is when the application contains an unhandled exception. Check the application logs, which can be found at the host URL under the /_logs path, for example:
    logs-url
    https://my-deployment-my-username.vercel.app/_logs
  • If you have tried the steps above and are still experiencing the error, check Vercel's status page for any reported outages in the Edge Network which can sometimes cause this error

When making a request to get the content of a page, the response buffer size exceeded the maximum value of 10 MB.


502: Prerender fallback file is too big for cache
Code: FALLBACK_BODY_TOO_LARGE
  • Inspect the code for the page in question to see how you can reduce the amount and size of content being returned as HTML or JSON
This can happen when the content is not available in the edge cache and it needs to be fetched from the static file at origin. In that case, the prerender of a static file content has a limit of 10 MB.
  • If the link is correct and you were not expecting this error, Contact Support.

The request for a Serverless Function was not completed successfully. This is an application error.


500: Internal Server Error
Code: FUNCTION_INVOCATION_FAILED
  • A common cause for this issue is when the application contains an unhandled exception. Check the application logs, which can be found at the host URL under the /_logs path, for example:
    logs-url
    https://my-deployment-my-username.vercel.app/_logs

The request for a Serverless Function reached the timeout threshold. This is an application error.


504: Gateway Timeout
Code: FUNCTION_INVOCATION_TIMEOUT

If you are seeing an execution timeout error, check the following possible causes:

  • The function is taking too long to process a request: Check that any API, or database requests you make in your function, are responding within the Serverless Function Execution Duration limit applicable to your plan.
  • The function isn't returning a response: The function must return an HTTP response, even if that response is an error. If no response is returned, the function will time out.
  • You have an infinite loop within your function: Check that your function is not making an infinite loop at any stage of execution.
  • Upstream errors: Check that any external API or database that you are attempting to call doesn't have any errors.
  • A common cause for this issue is when the application contains an unhandled exception. Check the application logs, which can be found at the host URL under the /_logs path, for example:
    logs-url
    https://my-deployment-my-username.vercel.app/_logs

For more information on Serverless Functions timeouts, see What can I do about Vercel Serverless Functions timing out?

An error occurred in the application when requesting a Serverless Function with a payload exceeding 6MB.


413: Request Entity Too Large
Code: FUNCTION_PAYLOAD_TOO_LARGE
  • Reduce the size of the request payload.

An infinite loop was detected within the application.


508: Loop Detected
Code: INFINITE_LOOP_DETECTED
  • Check the application's source code for a redirect loop.
  • Check the application's configuration redirects for a redirect loop.

An error occurred in the application when requesting a static resource with a request type other than GET or HEAD.


405: Method Not Allowed
Code: INVALID_REQUEST_METHOD
  • Check your client application logic or cURL command for a request type other than a GET or HEAD.

The application did not respond correctly, this is likely due to an exception being thrown from the function handler. Other reasons for this could be the following:

  • A global uncaught exception.
  • A global unhandled rejection.
  • A deployment that introduced incorrect syntax.

502: Bad Gateway
Code: NO_RESPONSE_FROM_FUNCTION
  • Open the realtime request logs for the application in a separate tab - this tab must be kept open while reproducing the error.
  • Repeat the application behavior that led to the error being thrown and review the realtime request logs where it will now show.
  • Use the information contained within the error present in the logs to understand where the function is failing.
  • If you're yet to implement a Log Drain, you can create one to persist errors from Serverless Functions.

The requested file or Serverless Function was not found in the application.


404: Not found
Code: RESOURCE_NOT_FOUND
  • Make sure the link you accessed is correct.
  • Check the output of your deployment.
  • If you believe the link is correct and you were not expecting this error; Contact Support along with the ID on the error page from your deployment.

An error occurred in the application when matching too many rewrites.


502: Bad Gateway
Code: TOO_MANY_FILESYSTEM_CHECKS
  • Reduce the number of rewrites that match the erroring request path.
  • Contact Support if you have trouble locating the rewrites causing the error.

An error occurred in the application when matching too many conditional routes. You cannot have more than 5 has routes matched on a single path.


502: Bad Gateway
Code: TOO_MANY_FORKS
  • Reduce the number of rewrites, redirects, or headers with a has key (conditional route) that match the erroring request path.
  • Contact Support if you have trouble locating the conditional routes causing the error.

This error occurs for Serverless functions only, when a request header contains non-UTF-8 characters. Typically, the cookie header contains such invalid characters (raw binary values for example).


400: Bad Request
Code: MALFORMED_REQUEST_HEADER
  • Make sure your request headers (especially cookie values) are valid UTF-8 string.
Last updated on October 3, 2023