Skip to content
2 min read

Edge Functions Limitations

Learn about the limitations and restrictions of using Edge Functions with Vercel with this reference.
Table of Contents
Choose a framework to optimize documentation to:

Edge Functions are neither Node.js nor browser applications, which means they don't have access to all browser and Node.js APIs. Currently, our runtime offers a subset of browser APIs and some Node.js APIs, and we plan to implement more in the future.

There are some restrictions to writing Edge Functions, which are documented in the Edge Runtime docs.

In summary:

  • Use ES modules
  • Most libraries which use Node.js APIs as dependencies can't be used in Edge Functions yet, but we're adding support for more Node.js APIs over time. See available APIs for a full list
  • Dynamic code execution (such as eval) is not allowed (see the next section for more details)

Dynamic code execution is not available in Edge Functions for security reasons. For example, the following APIs cannot be used:

Evaluates JavaScript code represented as a string
Creates a new function with the code provided as an argument
Compiles and instantiates a WebAssembly module from a buffer source

Most importantly, you need to make sure libraries used in your Edge Functions don't rely on dynamic code execution because it leads to a runtime error.

The Edge Function must begin sending a response within 25 seconds. You may continue streaming a response beyond that time.

Learn more about streaming responses from Edge Functions.

An Edge Function can only use up to 128 MB. If it exceeds this limit, the execution will be aborted and we will return a 502 error.

Limit (after gzip compression)
1 MB
2 MB
4 MB

The maximum size for an Edge Function includes your JavaScript code, imported libraries and files (such as fonts), and all files bundled in the function.

If you reach the limit, make sure the code you are importing in your function is used and is not too heavy. You can use a package size checker tool like bundle to check the size of a package and search for a smaller alternative.

Maximum URL length
14 KB
Maximum request body length
4 MB
Maximum number of request headers
Maximum request headers length
16 KB
  • The maximum number of requests from fetch API is 950 per Edge Function invocation.
  • The maximum number of open connections is 6.
    • Each function invocation can have up to 6 open connections. For example, if you try to send 10 simultaneous fetch requests, only 6 of them can be processed at a time. The remaining requests are put into a waiting queue and will be processed accordingly as those in-flight requests are completed.

To avoid CPU timing attacks, like Spectre, date and time functionality is not generally available. In particular, the time returned from only advances after I/O operations, like fetch. For example:

for (let i = 0; i < 1000; i++) {
  console.log(; // Prints the same value 1000 times.
await fetch('');
console.log(; // Prints another value.
Last updated on February 13, 2023