Innovateninjas / Paws-frontend

A fast responsive webapp that allows you to report injured stray animals to the nearest NGOs.
https://pawss.vercel.app
GNU General Public License v3.0
60 stars 99 forks source link

๐Ÿž[Bug]: #517

Closed uniyall closed 2 months ago

uniyall commented 2 months ago

Is there an existing issue for this?

Describe the bug

In routes other than '/', when user reloads or hard reloads, a '404: NOT_FOUND' error is thrown by vercel.

Expected behavior

Reloading shoud not lead to a 404 error for routes that do actually exist.

Add ScreenShots

paws_bug_vercel

What browsers are you seeing the problem on?

Chrome

Record

github-actions[bot] commented 2 months ago

Hi there! Thanks for opening this issue. We appreciate your contribution to this open-source project. Please make sure to read this issue for important guidelines. We aim to respond or assign your issue as soon as possible.

uniyall commented 2 months ago

I did some research and found out that this happens because the vercel servers donโ€™t know how to handle sub-pages (URLs). The fix is as simple as adding a vercel.json to the root directory and adding redirect rules.

@codewarnab Can I add this file? I have tested this by deploying (via vercel) a fork of the codebase (with vercel.json), and it seems to be working fine. You can test it out here - sample vercel deployment with vercel.json

codewarnab commented 2 months ago

good catch we are also facing this issue , do it and give a pr asap