Skip to content

TanStackStart

Source: src/Fly/Website/TanStackStart.ts

Deploy a TanStack Start application to Fly: the SSR server on a Machine, client assets baked into the image, served assets-first then the framework handler.

The build runs through @alchemy.run/frontend-frameworks/tanstack-start with the @alchemy.run/frontend-frameworks/tanstack-start/node deploy target — both must be installed in your project, alongside @tanstack/react-start (or @tanstack/solid-start) and vite.

Your vite.config.ts needs no adapter wiring: TanStack Start is pure Vite, so the integration drives the project’s own vite build, forces the SSR bundle to be self-contained, and wraps its fetch handler as a Node HTTP server on port 3000.

Basic TanStack Start App

const site = yield* Fly.Website.TanStackStart("Web", {
rootDir: "./app",
});

Custom Domain

const site = yield* Fly.Website.TanStackStart("Web", {
rootDir: "./app",
domain: "app.example.com",
});

Process Environment

const site = yield* Fly.Website.TanStackStart("Web", {
rootDir: "./app",
env: {
GREETING: "Hello from TanStack Start on Fly!",
},
});

Read An Environment Variable From A Server Function

src/routes/index.tsx
const getGreeting = createServerFn({ method: "GET" }).handler(
() => process.env.GREETING ?? "Hello!",
);