When i open my website it is all fine and working but when I go to any page from the header and reload/refresh the page it shows errors like this: 404: NOT_FOUNDCode: NOT_FOUNDID: bom1::jlwfm-1744309373433-7f82699a419a
I don’t know how can I fix it I have asked every AI and he is not able to fix it too.
Also I am getting unknown errors when deploying like:
[23:17:00.854] Skipping build cache, deployment was triggered without cache.
[23:17:01.499] Cloning completed: 654.000ms
[23:17:01.865] Running build in Washington, D.C., USA (East) – iad1
[23:17:02.035] Running "vercel build"
[23:17:02.417] Vercel CLI 41.5.0
[23:17:02.510] Error: Can't parse json file /vercel/path0/package.json: Expected ',' or '}' after property value in JSON at position 298 while parsing '{
[23:17:02.510] "name": "vite_react_shadcn_ts",
[23:17:02.510] "p'
[23:17:02.713]
Yes, i checked it but it didn’t helped me. Also i have tried many fixes but none worked. It would be very great if you help me with my project as it is my first project with node.js and with vercel. Thanks Alot!
Hey @murtazanaqvicoder your deployment error suggests your package.json file might me malformatted? I would first review that. More than happy to take a look if you have the repository available.
Yes, I don’t know why is it coming. It would be great if you would check my code or fix this error in all possible ways. All the deployment errors are now gone only this refresh issue still remains.
@murtazanaqvicoder Ah, I’ve run into this before with Vite projects. The issue is with React Router. Vite produces an SPA by default, and React Router just uses techniques like history.pushState for routing.
So you need all routes to redirect to the root SPA file (index.html), which you can do with a vercel.json config file in the root of your project:
Thanks alot man i appreciate it alot!
so the code you gave me i have to write it in a newly created vercel.json file?
Am i right?
Btw i have seen the site so you can delete it now.