11. Runtime
Bun is the default for everything that runs on your machine or in CI. Node is the deployed function runtime (D27).
Node stays supported everywhere, because the default must not become a requirement.
What M0 Verified
M0 verified Bun locally end to end under Bun 1.3.14 with Next 16.2.12. These all passed:
bun run --bun next build- production serving
- routing middleware
- ISR revalidation
Bun as the Vercel function runtime couldn't be verified against a live deployment. So it's an opt-in instead of the default until it is.
The Matrix
| Stage | Runtime | How |
|---|---|---|
| install | Bun | zero-config on Vercel |
| dev | Bun | bun run --bun next dev |
| build | Bun | bun run --bun next build |
| function runtime | Node | Vercel default, no config |
| function runtime, opt-in | Bun | {"bunVersion": "1.x"} in vercel.json |
| middleware | Node | Next 16 Proxy defaults to the Node runtime |
| tests | Bun | bun test |
| CLI | Bun | native TypeScript, no transpile step, compiles to a single binary |
Verify the opt-in Bun function runtime on a preview first.
Shipped Files
vercel.json ships with only the schema. Add "bunVersion": "1.x" to opt in to the Bun function runtime.
// vercel.json
{
"$schema": "https://openapi.vercel.sh/vercel.json"
}
// package.json
{
"scripts": {
"dev": "reeve route:sync && bun run --bun next dev",
"build": "reeve route:sync && bun run --bun next build",
"test": "bun test",
"check": "reeve doctor"
}
}
Known Gaps on the Bun Runtime
- No automatic source maps
- No bytecode caching
- No request metrics on
node:httpandnode:https. Metrics viafetchwork on both runtimes
None of these block v1. All 3 are worth stating in the docs, because "my stack traces got worse" is a support ticket you can prevent with one sentence.
Why Bun
- Native TypeScript execution. The CLI and generators have no transpile step and no
tsxdependency bun build --compileproduces a single-binary CLI, soreeveinstalls without a Node toolchainbun testis fast enough to run on save, which is the only property that decides whether tests actually get written- Install speed matters in CI when every package installs from a cold cache
The Constraint
**@avelonjs/core and @avelonjs/orm may never import bun:*.** The Bailiff rule no-bun-in-core enforces it.
3 reasons:
- A self-hoster running Node must be able to use this.
- Adapters other than Next may target runtimes where Bun isn't available.
- The day Bun and a deployment platform disagree about something you need, you want an exit that's a configuration change instead of a rewrite.
Bun-specific code is allowed in:
@avelonjs/cli, which always runs locally or in CI- driver packages. The ones that need Bun are listed under Node Fallback
Node Fallback
The fallback is Node 22 or later, with tsx for the CLI. It's slower, and it's supported.
These drivers import Bun's SQL client, so they don't load on Node:
@avelonjs/postgres- the
@avelonjs/neonqueue and token drivers
CI runs the suite on Bun 1.3.14 only. No job runs it on Node.