bun-sveltekit

Build and deploy SvelteKit applications on the Bun runtime with SSR and adapters.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires svelte-adapter-bun, @sveltejs/kit, svelte, vite, and includes references (resource) components.

What problem does it solve? Developers running SvelteKit on Node.js miss out on Bun's faster installs, builds, and native APIs like bun:sqlite, and configuring the Bun adapter, server hooks, and deployment correctly requires scattered documentation. ## Core Features & Use Cases - Bun Adapter Setup: Configure svelte-adapter-bun with precompression, dynamic origin, and environment prefixes for production builds. - Bun-Native Server Code: Use bun:sqlite in load functions, form actions, and API routes, plus Bun.file and Bun.write for file operations. - Svelte 5 Patterns: Implement runes-based components ($props, $state, $derived) wired to server load functions and form actions. - Deployment Guidance: Build and run with Bun directly or package into a multi-stage Docker image based on oven/bun. - Use Case: Scaffold a SvelteKit app with bunx sv create, add svelte-adapter-bun, build a CRUD page backed by bun:sqlite, and deploy it as a Docker container serving on port 3000. ## Quick Start Ask the assistant to scaffold a new SvelteKit project with Bun, configure svelte-adapter-bun, and create a users page backed by a bun:sqlite database.

Frequently Asked Questions about bun-sveltekit

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

FAQPage Schema
How do I run a SvelteKit app with Bun?

Create the project with bunx sv create, install dependencies with bun install, and add svelte-adapter-bun as the adapter in svelte.config.js. Run bun run dev for development and bun run build followed by bun ./build/index.js for production.

How do I use bun:sqlite in SvelteKit server routes?

Import Database from bun:sqlite inside load functions, form actions, or API routes, then run queries with db.query or db.run. Initialize the schema in hooks.server.ts and attach the database to event.locals for shared access.

Does SvelteKit support the Bun runtime for production?

Yes, via the svelte-adapter-bun package, which outputs a Bun-servable build directory. It supports options like precompress for gzip and brotli files, dynamic_origin, and xff_depth, and works in Docker using the oven/bun base image.

Why does SvelteKit show 'Cannot find bun:sqlite' errors?

This error occurs when the app runs on Node.js instead of Bun or uses the wrong adapter. Switch to svelte-adapter-bun and execute the built output with the bun command so Bun-native modules resolve correctly.

How do I deploy a Bun SvelteKit app with Docker?

Use a multi-stage Dockerfile based on oven/bun: install dependencies with bun install --frozen-lockfile, run bun run build, then copy the build output into a final image that runs bun ./build/index.js on port 3000.