aj112103
(Aamer Jalan)
January 5, 2025, 6:15am
1
The app renders perfectly when I first launch it but then everytime I refresh a page like my dashboard, login or profile page, vercel throws a 404 error saying that it can’t find the page in my directory.
https://tic-vision-y6v6.vercel.app/
this is what the console says:
Failed to load resource: the server responded with a status of 404 () - Despite the fact that all pages in the app run on the first render.
Could this be an issue with how I have structures my react app directory?
system
(system)
January 5, 2025, 6:15am
2
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.
Sometimes things don’t go as expected when deploying a website. If you see a 404 on your site, that means the page or resource couldn’t be found.
There are many possible causes, and the absence of something can be tricky debug if you don’t know where to look. Here are some things you can do to find the cause and fix it.
Debugging Tips
Check the error code
If you see a mostly white screen with 404: NOT_FOUND along with a Code and and ID then you can click the blue info box below the error deta…
A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0 .
aj112103
(Aamer Jalan)
January 5, 2025, 6:27am
3
I have resolved this, thank you
anshumanb
(Anshuman Bhardwaj)
January 6, 2025, 9:26am
4
Hi @aj112103 , nice to hear you solve this. Could you please share how you solved the issue to help other people who stumble on this post?
aj112103
(Aamer Jalan)
January 7, 2025, 6:37am
5
Yes absolutely. i added a vercel.json file to the root directory of my react app.
vercel.json:
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}
2 Likes
system
(system)
Closed
January 14, 2025, 6:37am
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.