Search code examples
firebasepolymerfirebase-hosting

Firebase hosting Page Not Found error on empty cache and hard reload


Firebase hosting is working fine! But this displayed Page Not Found (attached an image) page in two cases:

  1. Just after we deploy to Firebase hosting, 2-3 refresh is required to have expected page else it displayed Page Not Found page.
  2. When we do empty cache and hard reload it shows Page Not Found page.

Note: The page is designed using Polymer Web Components.

Check this link - https://yesitesapp.com/products

Please suggested - if any configuration or any settings is required to work Firebase hosting properly.

enter image description here


Solution

  • You have a service worker installed that precaches /products and then servers that path from the client cache.

    You have to modify your firebase.json config to serve your index.html file for all of the paths that your app uses. The Firebase docs have an example that should look something like this where it says handle all paths (**) with index.html.

    "hosting": {
      "rewrites": [ {
        "source": "**",
        "destination": "/index.html"
      } ]
    }