Overview

Edge Functions were separate from serverless functions; they are now Vercel Functions with the Edge runtime, a V8-isolate environment with Web APIs and no full Node.js. Vercel’s docs recommend migrating from Edge to Node.js “for improved performance and reliability”; both runtimes run on Fluid compute with Active CPU pricing. The Edge runtime is not removed for standalone Vercel Functions, but Next.js 16.3 deprecated export const runtime = "edge" in route segment config, and Vercel’s docs say routes and pages there run on Node.js. Default to Node.js (vercel).

Choose Edge only for small, request-shaped work

Edge still fits non-Next.js standalone functions that only need request data: token checks, header-based redirects, geolocation, request signing. Keep database queries, heavy computation, file generation, and Node-only SDKs on Node.js. Middleware patterns: nextjs-middleware.

Migrate a Next.js route by deleting the export

// before: delete this line; Node.js is the default runtime
export const runtime = "edge"

If the build warns about edge in route files (page, layout, route, API routes), remove the export and re-test anything that relied on Web-only APIs or on isolate-style startup. Patterns for Node handlers: nextjs-route-handlers.

Configure a standalone Edge function explicitly

// api/geo-redirect.ts (non-Next.js project)
import { geolocation } from "@vercel/functions"
export const config = { runtime: "edge" }
export default function handler(req: Request) {
  const country = geolocation(req).country ?? "us"
  return Response.redirect(`https://example.com/${country.toLowerCase()}`)
}

Respect the Edge runtime limits

Limits from Vercel’s Edge runtime docs (checked October 2026):

  • Code size after gzip: 1 MB Hobby, 2 MB Pro, 4 MB Enterprise.
  • A response must begin within 25 seconds; streaming can continue for up to 300 seconds.
  • Each environment variable is limited to 5 KB, even though the deployment total is 64 KB.
  • Available: Web APIs (fetch, Request, Response, Web Crypto, streams) plus async_hooks, events, buffer, assert, and util. Not available: fs, most other node:* modules, native addons, require, eval, and new Function.

Common traps: jsonwebtoken needs Node crypto, so use jose (Web Crypto) or verify on Node; bcrypt needs a native addon, so hash passwords on a Node route. Check the bundle with ANALYZE=true next build (needs @next/bundle-analyzer) and move heavy imports to a Node function called by fetch.

Skip warm-up pings and confirm on a preview

Do not schedule warming requests; the platform recycles isolates and warming only burns invocations. Bundle size drives startup, so keep one task per function. Local emulation (vercel dev, next dev) is close but not identical, so confirm on a vercel-preview-deployments build.