404 Error on Vercel Deployment Despite Successful Build

Hello everyone,

I’m running into a persistent 404 on my Next.js (App Router) project after deploying to Vercel. The build logs show a successful compile with a valid root route (/), and everything appears fine locally. However, visiting either my custom domain or the *.vercel.app subdomain always returns a 404.

Here’s what I’ve already tried:

  1. Root Route Check: Confirmed I have src/app/page.tsx with a default export (export default function Home() {…}).

  2. DNS Configuration:

• Apex domain points to 76.76.21.21 (A record)

• www subdomain is set as a CNAME to my .vercel.app

• Removed any circular references or extra CNAMEs.

  1. Vercel Project Settings:

• No “Root Directory” is set, because my code is in the repository root (with next.config.js and package.json there).

• The domain is confirmed as “Valid Configuration” in Vercel.

• I removed and re-added the domain to ensure no stale settings.

  1. Production Deployment: Double-checked that I’m deploying on the main branch and that the latest deployment is indeed marked as “Production.”

  2. Local Production Test: Ran npm run build && npm run start locally, and the site serves correctly on http://localhost:3000.

Despite all this, visiting my domain or the .vercel.app link still yields a 404. If anyone has run into a similar issue or has suggestions for what else to check, I’d really appreciate the help!

Thank you in advance!

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

Hey, Andrew! Welcome to the Vercel Community :wave:

Could you share your URL with us? :eyes:

Hey Pauline, sure. The url is https://www.betonyourself.today/

Did you try going through the community post? :eyes:

I did, yes. I did notice I didn’t have any sort of index file in my output, but I don’t know why that isn’t there. I have three other websites I have deployed with Vercel, and while they all have an index in their output, I can’t actually find that file in my codebase. I assume that is something Vercel creates during the build process, but that’s just a guess.

Hi @drosshole, sorry that you’re facing this issue.

Your project doesn’t seem to have the Next.js preset selected. Using the Next.js preset and redeploying your application should fix this issue.

This did it, thanks so much!