Build & Preview 404
run into a 404 at the preview mode. defined the app as SPA. spa: { enabled: true }
Cannot GET /
can anyone support me?
10 Replies
rare-sapphire•2mo ago
post a complete project please. also make sure to update to the latest versions
typical-coral•2mo ago
After creating a new TanStack Start project, I get a 404 error when serving the built app — without making any code changes.
npm run build
npm run serve

metropolitan-bronzeOP•2mo ago
I got the same exact error
rare-sapphire•2mo ago
this still applies
metropolitan-bronzeOP•2mo ago
I will prepare a project to post it but I believe I have already updated to the latest version
fascinating-indigo•2mo ago
Hi! I'm having the same issue as fmcoder
Environment:
- OS: Windows 11
- Node: v24.7.0
- TanStack Start: 1.132.48
- TanStack Router: 1.132.47
- Vite: 7.1.9
- React: 18.3.1
- pnpm: 9.14.2
Additional Context:
Migrated from React Router to TanStack Start manually following the "Build from Scratch" guide:
https://tanstack.com/start/latest/docs/framework/react/build-from-scratch
- Didn't use the official template to avoid overwriting existing files
- Created routes manually in src/routes/
- Set up root.tsx following the documentation
- Added server functions with createServerFn in src/server
- Configured vite.config.ts as per the guide
Issue:
-
pnpm dev works perfectly ✅
- pnpm build succeeds ✅
- pnpm preview shows "Cannot GET /" ❌
- node dist/server/server.js doesn't start (no output, port not listening) ❌
What i tried
- Using @netlify/vite-plugin-tanstack-start → breaks dev mode
- Using vinxi → errors with `dirname in ES modules
- Using node dist/server/server.js` → server doesn't listen on any port
Config:
- Using file-based routing
- Server functions with createServerFn
- Tailwind 4 + DaisyUI
Repo
https://github.com/Smailen5/portfolio-website/tree/fix/tanstanck-build-preview
Is there a way to test the production build locally?Build a Project from Scratch | TanStack Start React Docs
[!NOTE] If you chose to quick start with an example or cloned project, you can skip this guide and move on to the guide. So you want to build a TanStack Start project from scratch? This guide will hel...
GitHub
GitHub - Smailen5/portfolio-website at fix/tanstanck-build-preview
Sito portfolio e di presentazione, qui e possibile vedere una parte dei miei lavori e i progetti in corso. - GitHub - Smailen5/portfolio-website at fix/tanstanck-build-preview
rare-sapphire•2mo ago
Hosting | TanStack Start React Docs
Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the...
xenial-black•2mo ago
A lot of the docs pages including that one are showing a 404

rare-sapphire•2mo ago
we moved some pages around. new link https://tanstack.com/start/latest/docs/framework/react/guide/hosting
Hosting | TanStack Start React Docs
Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the...
manual-pink•2mo ago
I have same error. Fresh app - run build, run serve/preview -what ever is suggested by the logs - still failing..