Skip to content

Tanstack Start

Tanstack Start is the full-stack framework powered by TanStack Router for React and Solid.

Tanstack Start is compatible out of the box with fetch handlers (like on Cloudflare, Netlify, Vercel or Node):

vite.config.js
import netlify from "@vite-deploy/netlify";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [netlify({
// ...
handlerEntrypoint: "@tanstack/react-start/server-entry",
})]
});

If you want to use Tanstack Start with a Node handler, you will need to convert the fetch handler to a Node handler. We recommend srvx:

src/server.ts
import * as http from "node:http";
import { fileURLToPath } from "node:url";
import mod from "@tanstack/react-start/server-entry";
import sirv from "sirv";
import { toNodeHandler } from "srvx/node";
const server = http.createServer((req, res) =>
sirv(fileURLToPath(new URL("../client/", import.meta.url)), {
setHeaders: (res, pathname) => {
if (pathname.startsWith("/assets/")) {
res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
}
},
})(req, res, () => {
// @ts-expect-error
toNodeHandler(mod.fetch)(req, res);
}),
);
server.listen(3000, () => {
console.log("Ready at http://localhost:3000");
});