Edge Runtime
Encoding APIs
Web Stream APIs
Web Standards APIs
- Array
- BigInt
- BigUint64Array
- clearInterval
- console
- Date
- decodeURIComponent
- encodeURIComponent
- EvalError
- Float64Array
- Infinity
- Int16Array
- Intl
- isNaN
- Map
- Number
- parseFloat
- Promise
- RangeError
- RegExp
- setInterval
- SharedArrayBuffer
- Symbol
- TextDecoder
- TypeError
- Uint8ClampedArray
- Uint32Array
- URL
- WeakMap
- WebAssembly
You can use to access Environment Variables for both next dev
and next build
.
Running console.log
on process.env
will not show all your Environment Variables. You have to access the variables directly as shown below:
Unsupported APIs
- Native Node.js APIs are not supported. For example, you can’t read or write to the filesystem
node_modules
can be used, as long as they implement ES Modules and do not use native Node.js APIs- Calling directly is not allowed. Use ES Modules instead
The following JavaScript language features are disabled, and will not work:
eval
: Evaluates JavaScript code represented as a stringnew Function(evalString)
: Creates a new function with the code provided as an argumentWebAssembly.compile
WebAssembly.instantiate
with
In rare cases, your code could contain (or import) some dynamic code evaluation statements which can not be reached at runtime and which can not be removed by treeshaking. You can relax the check to allow specific files with your Middleware or Edge API Route exported configuration:
export const config = {
unstable_allowDynamic: [
'/lib/utilities.js', // allows a single file
'/node_modules/function-bind/**', // use a glob to allow anything in the function-bind 3rd party module
],
}
Be warned that if these statements are executed on the Edge, they will throw and cause a runtime error.