【发布时间】:2018-02-23 23:58:08
【问题描述】:
我正在我的页面上处理 PWA,我 100% 关注这个简单的代码实验室 - https://codelabs.developers.google.com/codelabs/add-to-home-screen/#0 并且一切正常(在使用的示例代码上,也在我自己的网页上),但只有在我测试时它在本地主机上。 在github页面上部署后,我遇到了很多错误:
-
GET https://[myusername].github.io/manifest.json 404 ()(即。 路径可能有问题,因为我猜在清单文件之前应该有项目名称) -
Manifest: Line: 1, column: 1, Unexpected token.(在 devtools 中我可以看到虽然它是普通的 json 文件,但在我的本地主机上运行良好); TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.- 在 devtools 中单击“添加到主屏幕”后,我得到:
Manifest: Line: 1, column: 1, Unexpected token.和Site cannot be installed: the manifest could not be fetched, is empty, or could not be parsed。
有什么想法吗?我不知道是我做错了什么还是github页面有问题......
【问题讨论】:
标签: javascript github github-pages progressive-web-apps