Where your code actually executes — Node.js, Edge, or the browser — and why it matters.
Next.js supports two distinct server runtimes for the same app. The Node.js runtime is the default, with full access to the Node API surface — file system, native modules, most npm packages work as expected. The Edge runtime, built on V8 isolates rather than a full Node process, runs closer to users geographically with much faster cold starts, but with a deliberately restricted API surface: no file system access, no native Node modules, and many npm packages that assume a full Node environment simply won't work.
You choose the runtime per route (or globally for Middleware) via an export const runtime declaration. The tradeoff is real: Edge gives you lower latency and near-instant cold starts, at the cost of compatibility — a package using Node's crypto module the old way, for instance, may need an Edge-compatible alternative. Middleware specifically only ever runs on the Edge runtime, with no option to switch it to Node.
What you'll walk away knowing