Fixing TanStack Deployment Not Found Error
Buildup
So you deployed your Tanstack Start application on Vercel and were greated with a 404 Not Found? Or maybe your earlier deployment was working fine but now suddenly shows this error? Don't worry, you're not alone :3
When I was deploying this dev.log website itself, I faced the same issue. The deployment was working and one commit later and suddenly I was greeted with a 404 Not Found error on my Vercel deployment. I spent a good amount of time debugging this issue, and after being haunted by this even in my dreams, I finally found the solution.
Like any developer in the big 2025, I turned to LLMs for help. "State of the art"? "Cutting edge"? Pfft, more like "state of confusion" and "cutting my productivity". They kept recommending me to add vercel.jsonor modify some random config that doesn't even exist.
Finally, I gave up.
I gave up and went to sleep, hoping that the solution would come to me in my dreams. And lo and behold, it did! The next morning, I woke up with a fresh mind and a clear head. I decided to take a look at the issue again, this time with a different perspective. Okay enough drama, here's the actual solution:
The Root issue
If you deployed a fresh Tanstack Start application on Vercel, the build command generates a dist directory that holds your build. But later on, when you turned on that sweet sweet "Prerendering", it actually divided your build into dist/clientand dist/server. Now Vercel is still looking for the dist directory, but it doesn't have the build! Hence the 404 Not Found error.
Even though your build completes successfully, Vercel can't find the files it's looking for. So we need to tell Vercel to look for the right directory.
The Fix
The fix is simple. We need to tell Vercel to look for the dist/client directory instead of dist. To do this, we need to modify the build output settings in Vercel.
Go to your Vercel dashboard, select your project, and navigate to the "Settings" tab. Under the "Build & Development Settings" section, find the "Output Directory" field. Change it from dist to dist/client.
Save the changes and redeploy your application. Vercel will now look for the correct directory and your deployment should work without any issues.
Conclusion
And that's it! You have successfully fixed the 404 Not Found error in your Vercel deployment of Tanstack Start application. Remember, sometimes the solution is simpler than we think. Don't hesitate to take a step back and look at the problem from a different angle.
I am writing this blog as a way to help others who might face the same issue in the future. If you found this blog helpful, feel free to share it with your friends and colleagues. Happy debugging guys :3