Why are some routes of my react app not working?

I just created a Youtube clone with react (using vite). When I published it to netlify, I noticed that some routes were not working, while others were working fine. For example when someone visited a channel on the app (/channel/:id) everything seemed fine, but whenever they go to the saved videos route (/saved-videos) it shows an error: Page Not Found. How can i fix this problem?

Please share your site name to help us see the problem.

But in most cases, it’s because of non-followed documentation:

I just figured the problem. In my main.jsx file I changed BrowserRouter with HashRouter and everything seems to be working perfectly fine.

1 Like

Hi @Lindrit_Sulaj :wave:t6: ,

Welcome to the Netlify support forums. Thanks for letting us know what helped you solve your problem. We appreciate the feedback and I hope someone else can use this tip if they encounter a similar problem.

1 Like