next.js& PWA:灯塔在清单中找不到图标。
我正在尝试将现有的NextJS应用程序转换为PWA。 当我在http:// localhost上运行灯塔报告时:3000
yarn build&&纱线开始
我看到了这两个错误:
- 失败:清单没有至少512px的PNG图标。
- 清单没有可掩盖的图标
,但是我的清单确实包含一个大小的单个图像文件
- :1024x1024
- 类型:
任何掩模
这是我的清单文件:
{
"name": "my-app",
"short_name": "my-app",
"theme_color": "#eee57c",
"background_color": "#eee57c",
"display": "fullscreen",
"orientation": "portrait",
"scope": "/",
"start_url": "/",
"icons": [
[
{
"src": "./icons/1024.png",
"sizes": "1024x1024",
"type": "image/png",
"purpose": "any maskable"
}
]
],
"splash_pages": null
}
下面也是我的public的屏幕截图/
在public> public/icon
下显示1024.png
的文件夹。
我还尝试更改路径ICONS/1024.png
/icons/1024.png
和当前./ icons/ 1024.png
,但没有一个使错误消失。
为什么Lighthouse报告没有大小&GT的PNG; 512px还是可掩盖的图像?
I'm trying to convert an existing NextJS app to a PWA.
When I run lighthouse report on http://localhost:3000
after yarn build && yarn start
I see these 2 errors:
- Failures: Manifest does not have a PNG icon of at least 512px.
- Manifest doesn't have a maskable icon
However my manifest does contain a single image file that is
- size: 1024x1024
- type:
any maskable
This is my manifest file:
{
"name": "my-app",
"short_name": "my-app",
"theme_color": "#eee57c",
"background_color": "#eee57c",
"display": "fullscreen",
"orientation": "portrait",
"scope": "/",
"start_url": "/",
"icons": [
[
{
"src": "./icons/1024.png",
"sizes": "1024x1024",
"type": "image/png",
"purpose": "any maskable"
}
]
],
"splash_pages": null
}
Below is also a screenshot of my public/
folder showing there is indeed an 1024.png
under public/icon
.
I have also tried changing the path icons/1024.png
/icons/1024.png
and the current ./icons/1024.png
but none of them make the errors go away.
Why is Lighthouse reporting that there is no PNG with size > 512px or a maskable image?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论