Demo, all content is generated
Question

Vercel says deployment Ready but my site is just '404: NOT_FOUND'

Open · 153 views · asked by precious_n · edited

I exported my Lovable project to GitHub and imported it in Vercel. Build log is green, status says Ready. But opening the URL gives a white page with:

404: NOT_FOUND
Code: NOT_FOUND
ID: fra1::abc12-1726...

Not even my home page loads. My launch post is scheduled for Monday, please help.

What I’ve tried

Redeployed twice, and deleted and re-imported the project. Same 404 every time.

Comment
What does the build log say at the very end? And what is the Framework Preset in project settings? dmitri_v · edited

3 answers

deploydan · edited

A green build and a 404 on / almost always means Vercel deployed the wrong folder. Project Settings → Build & Deployment:

  • Framework Preset: Vite (not "Other")
  • Build Command: npm run build
  • Output Directory: dist

With "Other", Vercel can run your build fine and then publish the repo root, where there is no built index.html. Fix the settings and redeploy.

Comment
It was on Other! Changed to Vite, home page loads now. But if I refresh on /menu I get the same 404 again precious_n · edited
That's the SPA part: add a vercel.json with a rewrite of everything to /index.html. Then refresh works on every route. deploydan · edited
mariam_k · edited

Also check Root Directory in the same settings page. My repo had the app in a subfolder (/app) and Vercel built from the root. The build "succeeded" because there was nothing to build.

Comment
isabel_m · edited

Side note: the fra1:: part of that 404 ID is just the edge location that served the request, not where the problem is. Include the full ID if you ever need to contact Vercel support.

Comment