next
Version:
The React Framework
26 lines (20 loc) • 1.1 kB
Markdown
---
title: runtime
description: API reference for the runtime route segment config option.
---
The `runtime` option allows you to select the JavaScript runtime used for rendering your route.
```tsx filename="layout.tsx | page.tsx | route.ts" switcher
export const runtime = 'nodejs'
// 'nodejs'
```
```js filename="layout.js | page.js | route.js" switcher
export const runtime = 'nodejs'
// 'nodejs'
```
- **`'nodejs'`** (default)
- **`'edge'`** (deprecated)
> **Good to know**:
>
> - The Edge Runtime is deprecated. Remove the `runtime` export from your route files. See [Edge Runtime Deprecated](/docs/messages/edge-runtime-deprecated).
> - When [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents) is enabled, remove the `runtime` export, including `runtime = 'nodejs'`. Cache Components uses the default Node.js runtime and does not support the `runtime` route segment config. See [Migrating to Cache Components](/docs/app/guides/migrating-to-cache-components#runtime--edge).
> - This option cannot be used in [Proxy](/docs/app/api-reference/file-conventions/proxy).