更新
由于没有进行任何更改,Lighthouse神秘地停止了显示“在页面上找不到可用的Web应用程序清单”消息,现在显示为“超时,等待start_url响应”。当然,这是另一篇文章的主题。
我尚不知道为什么Lighthouse停止显示上一条错误消息。
我刚刚第一次在我的应用程序中添加了PWA功能。Chrome Lighthouse说“页面上找不到可用的Web应用清单”。
但是Chrome应用程序>>清单工具报告存在manifest.json文件-甚至从其中读取数据:
Here's what the manifest.json file looks like:
{
"short_name": "mySiteName",
"name": "mySiteName",
"start_url": "/",
"display": "standalone",
"theme_color": "#ffffff",
"theme-color": "#ffffff",
"background_color": "#000000",
"background-color": "#000000",
"description": "my site description",
"icons": [
{
"src": "/images/app-images/myLogo.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/images/app-images/myLogo.png",
"type": "image/png",
"sizes": "512x512"
}
]
}
Why is Lighthouse saying the manifest.json isn't found -- when the Chrome Application>>Manifest tool says that it is?
Update:
A commenter asked if I'd linked the manifest in the <head>
. Going to the production server and clicking view source
, I see in the <head>
tag:
<head>
[.....]
<meta charset="utf-8">
<meta name="robots" content="noindex">
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<noscript>This site requires Javascript. Please activate JavaScript in your browser.</noscript>
[.....]
</head>
If I paste https://www.mywebsite.care/manifest.json
into the browser, my manifest.json file comes up. So it appears that I have linked the manifest.json file in the <head>
section.
I found out that when you are updating a pwa implementation, it's not enough to delete the old serviceworker from the Chrome devtools Application tab -- it's also often necessary to delete the old Cache Storage on the Application tab as well. I guess what was happening may have been a stale cache error.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句