Subject: Website showing 404 Not Found after successful deployment
Current versus Expected behavior
- Current behavior: My website deployed on Vercel at
embico-test.vercel.app
is showing a “404: This page could not be found” error page. - Expected behavior: The website should display the content of the root page (
/
) as it does in my local development environment.
Code, configuration, and steps that reproduce this issue
- Project Setup: This is a Next.js project using React and TypeScript.
- Local Environment: The project works correctly when running locally (
npm run dev
) and is accessible athttp://localhost:3000
. - GitHub Repository: The project source code is hosted on GitHub at
https://github.com/ii-johan/my-embico-app
. I have recently cleaned up the repository to remove build output folders (_next
,.next
,out
, etc.) andnode_modules
, ensuring only source files are present. next.config.ts
: The project is configured for static site export with the following setting:
const nextConfig: NextConfig = {
// ... other configs
output: 'export', // Configured for static export
// ... other configs
};
- Vercel Deployment: The project is connected to the GitHub repository, and Vercel automatically triggers deployments on new commits. The latest deployment shows “Deployed (completed)” status.
- Vercel Logs:
- Build logs show the build process completed successfully with no errors.
- The logs indicate that the root path (
/
) was prerendered as static content (○ / prerendered as static content
). - Runtime logs show no errors.
- Steps Taken:
- Confirmed Vercel is connected to the correct GitHub repository (
ii-johan/my-embico-app
). - Verified Vercel’s Root Directory setting is correct (empty, matching GitHub root).
- Manually cleaned the GitHub repository via the website to remove build outputs and
node_modules
. - Triggered re-deployments on Vercel after cleaning the GitHub repo.
- Cleared smartphone browser cache before accessing the Vercel URL.
Despite a successful build and no runtime errors, and confirming the static export configuration and clean GitHub repo, the deployed site still shows a 404 error. It seems Vercel might not be correctly serving the generated index.html
file for the root path.
Project information (URL, framework, environment, project settings)
- Vercel Project URL:
https://embico-test.vercel.app
(The specific deployment URL ismy-embico-lmgawllpr-ii-s-projects.vercel.app
, but the primary domain isembico-test.vercel.app
) - GitHub Repository URL:
https://github.com/ii-johan/my-embico-app
- Framework: Next.js (Version 15.3.2), React (Version 19.0.0)
- Environment: Production
- Vercel Project Settings: Standard Next.js settings, Root Directory empty, Build Command
npm run build
, Output Directory automatically detected (should beout
due tooutput: 'export'
).