'vercel 404 page css not loading css when an extra / is found after the domain name

I am using vercel to host my website and I used the vercel.json file to route my 404 page. The 404 page works fine if the domain is something like this: https://example.com/first enter image description here

But if the domain is like https://example.com/first/second it won't load the CSS or javascript because the file route is now different.

enter image description here

here is my vercel.json

{
  "routes": [
    { "handle": "filesystem" },
    { "src": "/(.*)", "status": 404, "dest": "/404.html" }
  ]
}

How can I solve this problem? I'm not using a serverless function, you can see the source code at https://github.com/crispy-cream/specs. Files are



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source