Skip to main content
Deploy TanStack Start applications to Cloudflare Workers with automatic configuration.

Installation

Install the required dependencies:

Configuration

Configuration Options

Properties

  • bindings: Cloudflare bindings (KV, R2, D1, etc.)
  • entrypoint: Worker entrypoint path
    • Default: dist/server/index.js
  • assets: Static assets directory
    • Default: dist/client
  • wrangler.main: Path to server entry point
    • Default: src/server.ts (if exists), otherwise uses @tanstack/react-start/server-entry
  • compatibility: Node.js compatibility mode
    • Default: "node"
  • noBundle: Skip bundling
    • Default: true

Accessing Bindings

Access Cloudflare bindings in your TanStack Start application:

Server Functions

API Routes

Loaders

TypeScript Configuration

Define types for your Cloudflare bindings:

Local Development

Start the TanStack Start dev server:
The Alchemy Vite plugin provides:
  • Local emulation of Cloudflare bindings
  • Hot module replacement
  • Fast refresh

Custom Dev Configuration

Server Entry Point

The resource automatically detects your server entry point:
  • If src/server.ts exists, it will be used
  • Otherwise, falls back to @tanstack/react-start/server-entry

Custom Server Entry

Specify a custom server entry:

Node.js Compatibility

TanStack Start automatically enables Node.js compatibility:
  • Node.js built-in modules
  • npm packages with Node.js dependencies
  • Full TanStack Start feature set

Deployment Best Practices

  • Keep dist/ directory in .gitignore
  • Use environment variables for secrets via alchemy.secret.env.X
  • Test locally with Vite dev server
  • Configure proper TypeScript types for bindings
  • Use server functions for data fetching