Error while refreshing the app

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?

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.

I have resolved this, thank you

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?

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

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.