Angular 6 @angular/pwa - 软件未成功提供清单的 start_url
Angular 6 @angular/pwa - sw does not successfuly serve the manifest's start_url
我使用 angular 6 和 @angular/pwa 包构建了一个 PWA。
我一直在尝试解决此问题,但无论我做什么,我都收到 start_url 错误。我试过:
- 使用绝对链接
- 确保 start_url 在 SW 的范围内(sw 在主文件夹中)
- 使用我在其他支持主题中看到的文件名“/index.html”。
- 每次都清除所有浏览器历史记录和缓存。
- 在@angular/pwa 包
上搜索 Github 个问题
- 一般搜索 google 此 PWA 问题。
这是我的清单:
{
"name": "BC Doc View",
"short_name": "BCview",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/",
"start_url": "/",
这段代码后就是一堆图标,与此无关post。
我的 service worker 配置:
{
"index": "/index.html",
"assetGroups": [
{
"name": "BC Doc View",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
我使用 ng build --prod 命令实际生成的 Service Worker 有 2200 行代码,所以我认为它与此处的 post 无关。
不知道我在这方面遗漏了什么。
我已经为这个错误哭了 3 个小时,几分钟后我 post 我在这里找到了解决方案。
我一直在将其测试到 dev 子域中并像 subdomain.domain 一样访问它。com/folder
将所有内容放入主文件夹后,我的 PWA 得分为 100。
https://i.imgur.com/ex3Os87.png
虽然我还没有优化性能。
我使用 angular 6 和 @angular/pwa 包构建了一个 PWA。
我一直在尝试解决此问题,但无论我做什么,我都收到 start_url 错误。我试过:
- 使用绝对链接
- 确保 start_url 在 SW 的范围内(sw 在主文件夹中)
- 使用我在其他支持主题中看到的文件名“/index.html”。
- 每次都清除所有浏览器历史记录和缓存。
- 在@angular/pwa 包 上搜索 Github 个问题
- 一般搜索 google 此 PWA 问题。
这是我的清单:
{
"name": "BC Doc View",
"short_name": "BCview",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/",
"start_url": "/",
这段代码后就是一堆图标,与此无关post。
我的 service worker 配置:
{
"index": "/index.html",
"assetGroups": [
{
"name": "BC Doc View",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
我使用 ng build --prod 命令实际生成的 Service Worker 有 2200 行代码,所以我认为它与此处的 post 无关。
不知道我在这方面遗漏了什么。
我已经为这个错误哭了 3 个小时,几分钟后我 post 我在这里找到了解决方案。
我一直在将其测试到 dev 子域中并像 subdomain.domain 一样访问它。com/folder
将所有内容放入主文件夹后,我的 PWA 得分为 100。
https://i.imgur.com/ex3Os87.png
虽然我还没有优化性能。