Next.js works with Bun as the JavaScript runtime and package manager.
Quick Start
bun create next-app my-app
cd my-app
bun dev
Manual Setup
Install dependencies
bun add next react react-dom
Add scripts to package.json
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}
}
Create pages/index.tsx
export default function Home() {
return <h1>Hello Next.js + Bun</h1>;
}
Next.js is fully compatible with Bun’s package manager and runtime.