bun-tanstack-start

Build full-stack React applications with TanStack Start on the Bun runtime.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/react-router, @tanstack/start, react, react-dom, vinxi, zod, and includes references (resource) components.

What problem does it solve? Setting up a full-stack React application with TanStack Start on Bun involves many moving pieces—file-based routing, server functions, API routes, vinxi configuration, and SSR presets—and misconfiguration leads to cryptic build and hydration errors. This Skill provides working patterns and fixes so you can scaffold, develop, and deploy without trial and error. ## Core Features & Use Cases - Project Scaffolding & Configuration: Create a TanStack Start app with bunx, configure package.json scripts, and set the Bun server preset in app.config.ts. - Routing & Data Loading: Implement file-based routes, dynamic segments, loaders, search param validation with zod, and error/pending components. - Server Functions & API Routes: Write type-safe server functions with createServerFn, access request context, and build REST endpoints backed by bun:sqlite. - Use Case: Build a CRUD app where a /users page loads data via a server function, submits new users through a form POST, and deploys to production with a Bun-preset Docker image. ## Quick Start Ask the assistant to scaffold a new TanStack Start project with Bun and create a users route with a server function backed by bun:sqlite.

Frequently Asked Questions about bun-tanstack-start

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

FAQPage Schema
How do I create a TanStack Start project with Bun?

Run bunx create-tanstack-start@latest my-app, then cd into the directory and run bun install. Use bun run dev to start the vinxi dev server, bun run build to build, and bun run start to preview the production output.

How do server functions work in TanStack Start?

Server functions are created with createServerFn from @tanstack/start, specifying an HTTP method like GET or POST. They run only on the server, can access databases like bun:sqlite directly, and are called from route loaders or components like regular async functions.

Does TanStack Start support the Bun runtime for deployment?

Yes, set server.preset to "bun" in app.config.ts or build with NITRO_PRESET=bun. The output in .output/server/index.mjs runs directly with the bun command, and a multi-stage Dockerfile using oven/bun images is a standard deployment approach.

Why does TanStack Start show 'Cannot find bun:sqlite' errors?

This error occurs when the server preset is not set to Bun, so the build targets Node.js where the bun:sqlite module does not exist. Fix it by setting server.preset to "bun" in app.config.ts and rebuilding.

How do I validate search params in TanStack Router?

Define a zod schema for your search params and pass it to the route's validateSearch option in createFileRoute. The validated, typed params are then available in the loader via the search argument.