N Next.js 中文
原文 ↗
Next.js 文档/API Reference / API 参考/Route Segment Config / 路由段配置

runtime

runtime 路由段配置选项的 API 参考。

更新于 2026-10-15Next.js 16.4.6

runtime 选项允许你选择用于渲染路由的 JavaScript 运行时。

TypeScript

layout.tsx | page.tsx | route.tstsx
export const runtime = 'nodejs'
// 'nodejs'

JavaScript

layout.js | page.js | route.jsjs
export const runtime = 'nodejs'
// 'nodejs'
  • 'nodejs'(默认)
  • 'edge'(已弃用)

须知: