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.
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-runtimeCommon 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
- Replace
process.env.Xreads that the edge sandbox blocks with supported access patterns. - Swap
Bufferandfsusage for Web APIs (TextEncoder, fetch, KV/blob storage). - 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.
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.