Skip to content
Latchkey

Vercel Edge "A Node.js API is used ... not supported" in CI

The Edge runtime implements Web APIs, not the full Node.js API. References like process.cwd, Buffer, or fs are flagged at build time because the runtime does not provide them.

What this error means

The Vercel build warns or fails with "A Node.js API is used (process.nextTick at line ...) which is not supported in the Edge Runtime", pointing at a file or dependency.

Vercel
A Node.js API is used (process.version at line: 12) which is not supported in
the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Common causes

Edge code reads a Node-only global

A route or middleware on the Edge runtime references process, Buffer, __dirname, or a node: module that the edge sandbox does not expose.

A dependency assumes Node at import time

A library reads process.version or similar during module initialization, so importing it into an edge bundle trips the check.

How to fix it

Use Web-standard equivalents

  1. Replace process.env.X reads that the edge sandbox blocks with supported access patterns.
  2. Swap Buffer and fs usage for Web APIs (TextEncoder, fetch, KV/blob storage).
  3. Remove dependencies that touch Node globals at import time.

Run the route on the Node runtime

When the code truly needs Node APIs, set the route runtime to nodejs so the function runs on the Node serverless runtime.

app/route.ts
export const runtime = 'nodejs';

How to prevent it

  • Keep edge routes on Web-standard APIs only.
  • Audit dependencies for Node globals before importing them into edge code.
  • Use the Node runtime for routes that depend on process, Buffer, or fs.

Frequently asked questions

What causes ""A Node.js API is used which is not supported""?
A route or middleware on the Edge runtime references process, Buffer, __dirname, or a node: module that the edge sandbox does not expose.
How do I fix "A Node.js API is used which is not supported"?
Use Web-standard equivalents

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card