Hello Vercel Community and Support Team,
I am experiencing a persistent 404 Not Found error on the root path of my project, even after extensive troubleshooting. My goal is to serve a simple static index.html file from the /public directory, alongside a serverless function in /api.
Project Details:
- Failing Deployment URL: https://rht-final-panel.vercel.app/
- GitHub Repository: https://github.com/RanhuixinLiu/rht-final-panel
My vercel.json Configuration:
I am using a very explicit configuration to ensure the build and routing are correct, but the issue persists.
{
"version": 2,
"builds": [
{
"src": "api/proxy.js",
"use": "@vercel/node"
},
{
"src": "public/**",
"use": "@vercel/static"
}
],
"rewrites": [
{
"source": "/api/proxy/(.*)",
"destination": "/api/proxy"
}
]
}
Troubleshooting Steps Already Taken:
I believe I have exhausted all possible user-side solutions, including:
- Verified File Structure: Confirmed
index.htmlis correctly located inside/public, all with correct lowercase naming. - Multiple Configs: Tried several
vercel.jsonconfigurations, from simplerewritesto explicitbuildsandroutes. The current one is the most explicit. - Verified Build Output: Checked the deployment’s “Output” tab, which correctly shows both the
static/index.htmlfile and theapi/proxy.jsfunction. This indicates the build process is working as expected. - Complete Project Reset: I completely deleted the old Vercel project and the old GitHub repository.
- Created a New Project: I created a brand new, clean GitHub repository (
rht-final-panel) and a brand new Vercel project from scratch, using Vercel’s default settings and only adding environment variables.
Despite all these steps, the 404 error on the root path (/) continues to happen. This seems to be a platform-level issue with static file routing for my project, as the code, configuration, and build output all appear to be correct.
Could anyone from the Vercel team or the community investigate why a request to the root path is not being served by the public/index.html file present in the build output?
Thank you for your help.