Deploy to Vercel as a TanStack Start app via Nitro

Vercel served 404s: with Hydrogen gone it treated the app as a static
Vite site, but TanStack Start's build has no index.html; pages come from
its server. Add the hosting adapter TanStack documents for Vercel:

- nitro() in vite.config, for 'vite build' only (dev and the nodesandbox
  runtime never load it); on Vercel it writes .vercel/output with the
  static assets and one Node.js function running Start + Hono
- vercel.json: tanstack-start preset, Yarn 4 via Corepack
- 'yarn start' runs the Node build; canonical URLs use the Vercel domain

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rami Bitar
2026-10-03 15:47:53 -04:00
co-authored by Claude Opus 5.5
parent 7ec0029b08
commit 55423c7204
6 changed files with 182 additions and 7 deletions
+2
View File
@@ -6,6 +6,7 @@
"scripts": {
"dev": "vite dev --host 0.0.0.0 --port 3000",
"build": "vite build",
"start": "node .output/server/index.mjs",
"typecheck": "tsc --noEmit"
},
"packageManager": "yarn@4.18.0+sha512.fcb8716fe7cd0eece141ffc18b92193a9df9204c1ba83189c288835223fc0bbe64af473bab0d5e9927a7daeb5caf2bb07eb2787cc9338ca040ea125f2a1f2f7e",
@@ -24,6 +25,7 @@
"framer-motion": "^12.42.2",
"hono": "^4.13.12",
"lucide-react": "^0.562.0",
"nitro": "3.0.260903-beta",
"radix-ui": "^1.6.7",
"react": "^19.3.0",
"react-dom": "^19.3.0",