bun-nextjs

Configures and runs Next.js applications on the Bun JavaScript runtime.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aicodepro/ai-agent-nexi --skill bun-nextjs-aicodepro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-nextjs
Source: https://github.com/aicodepro/ai-agent-nexi/tree/main/agent/skills/bun-nextjs
Command: npx skills add https://github.com/aicodepro/ai-agent-nexi --skill bun-nextjs-aicodepro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires next, react, react-dom, and includes references (resource) components.

What problem does it solve? Developers want to run Next.js applications on the Bun runtime for faster installs, development, and builds, but face friction around runtime flags, Bun-specific APIs like bun:sqlite, configuration, and deployment targets. ## Core Features & Use Cases - Project Scaffolding and Setup: Create a Next.js app with bunx create-next-app, configure package.json scripts, and force the Bun runtime with the --bun flag. - Bun APIs in Next.js: Use bun:sqlite and Bun.file in Server Components, API routes, and Server Actions for data access without external databases. - Configuration and Deployment: Set up next.config.js with Turbopack and serverExternalPackages, then deploy via Docker or Vercel with awareness of edge runtime limits. - Use Case: Build a CRUD dashboard where API routes and Server Actions read and write directly to a local SQLite database through bun:sqlite, all served by the Bun runtime. ## Quick Start Ask the assistant to scaffold a new Next.js app with Bun and configure it to run on the Bun runtime with a SQLite-backed API route.

Frequently Asked Questions about bun-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Next.js with the Bun runtime?

Run Next.js on Bun by prefixing scripts with bun --bun, for example bun --bun next dev. The --bun flag forces Next.js to use Bun's runtime instead of Node.js for development, build, and start commands.

How do I create a Next.js app with Bun?

Create a Next.js app with Bun by running bunx create-next-app@latest my-app, then install dependencies with bun install. Use bun run dev, bun run build, and bun run start for the standard workflow.

Can I use bun:sqlite in Next.js API routes?

Yes, bun:sqlite works in Next.js API routes, Server Components, and Server Actions when running on the Bun runtime. Add bun:sqlite to serverExternalPackages in next.config.js and declare it as a webpack external for server builds.

Does Bun work with Vercel edge runtime in Next.js?

No, Vercel's edge runtime uses V8, not Bun. Bun APIs only work in Server Components, API routes, and Server Actions running on the Node.js runtime, so avoid Bun-specific imports in edge middleware or edge routes.

Why does Next.js throw Cannot find bun:sqlite?

The Cannot find bun:sqlite error occurs when Next.js runs on Node.js instead of Bun. Fix it by starting the server with bun --bun next dev so the Bun runtime provides the bun:sqlite module.