#edge runtime's node compatibility

1 messages · Page 1 of 1 (latest)

hallow trout
#

which node built-in modules are available on the edge runtime?

terse oxideBOT
#

Hi @hallow trout. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The Edge Runtime in Next.js is compatible with a subset of Node.js modules. The following modules can be imported with and without the node: prefix when using the import statement:

Also, Buffer is globally exposed to maximize compatibility with existing Node.js modules.

Please note that the Edge Runtime does not support all Node.js APIs, meaning some npm packages may not work. For example, you might encounter errors like "Module not found: Can't resolve 'fs'" or similar. If you need to use these APIs or packages, it's recommended to use the Node.js runtime instead.

Source (https://vercel.com/docs/functions/edge-middleware/edge-runtime)

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: