The Bun runtime is in Beta; certain features (e.g., automatic source maps, byte-code caching,
metrics on
node:http/https) are not yet supported.Bun.serve is currently not supported on Vercel Functions.Use Bun with frameworks supported by Vercel, like
Next.js, Express, Hono, or Nitro.1
Configure Bun in vercel.json
To enable the Bun runtime for your Functions, add a Vercel automatically detects this configuration and runs your application on Bun. The value has to be
bunVersion field in your vercel.json file:vercel.json
"1.x", Vercel handles the minor version internally.For best results, match your local Bun version with the version used by Vercel. Currently, Bun version 1.2.23 is supported.2
Next.js configuration
If you’re deploying a Next.js project (including ISR), update your This ensures both local development and builds use Bun.
package.json scripts to use the Bun runtime:package.json
The
--bun flag runs the Next.js CLI under Bun. Bundling (via Turbopack or Webpack) remains unchanged, but all commands execute within the Bun runtime.3
Deploy your app
Connect your repository to Vercel, or deploy from the CLI:Or install the Vercel CLI globally:Learn more in the Vercel Deploy CLI documentation →
terminal
terminal
4
Verify the runtime
To confirm your deployment uses Bun, log the Bun version:
index.tsSee the Vercel Bun Runtime documentation for feature support →
- Fluid compute: Both Bun and Node.js runtimes run on Fluid compute and support the same core Vercel Functions features.
- Middleware: To run Routing Middleware with Bun, set the runtime to
nodejs: