【问题标题】:Firebase hosting Page Not Found error on empty cache and hard reloadFirebase 托管页面未找到空缓存和硬重新加载错误
【发布时间】:2018-12-16 06:46:54
【问题描述】:

Firebase 托管运行良好! 但是这个显示Page Not Found(附图片)页面有两种情况:

  1. 在我们部署到 Firebase 托管之后,需要 2-3 次刷新才能获得预期页面,否则会显示“未找到页面”页面。
  2. 当我们清空缓存并硬重新加载时,它会显示 Page Not Found 页面。

注意:该页面是使用 Polymer Web 组件设计的。

检查此链接 - https://yesitesapp.com/products

请建议 - 如果需要任何配置或设置才能正常工作 Firebase 托管。

【问题讨论】:

    标签: firebase polymer firebase-hosting


    【解决方案1】:

    您安装了一个预先缓存 /products 的服务工作者,然后从客户端缓存中服务器该路径。

    您必须修改您的 firebase.json 配置,以便为您的应用程序使用的所有路径提供您的 index.html 文件。 Firebase 文档有一个 example 应该看起来像这样,它说使用 index.html 处理所有路径 (**)。

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

    【讨论】:

    • 非常感谢,它也适用于子文件夹:"manager/**""manager/index.html"
    猜你喜欢
    • 2019-09-03
    • 2021-11-11
    • 2017-10-14
    • 1970-01-01
    • 2012-06-09
    • 2019-04-02
    • 2016-08-01
    • 2018-12-05
    • 2020-09-15
    相关资源
    最近更新 更多