首页 > 解决方案 > 如何使用 manifest / service-worker 制作 PWA?

问题描述

我的 manifest.json 中有语法错误

清单:第 7 行,第 1 列,语法错误。

我正在尝试删除文件中的所有数据,但我得到了同样的错误。

看看我的 manifest.json

{
"name" : "VIDEOFUTUR",
"short_name" : "VF",
"description" : "Télécom",
"start_url" : "index.php",
"scope" : "/",
"display" : "fullscreen",
"orientation" : "any",
"lang" : "French",
"icons" : [
    {
        "src": "https://lafibrevideofutur.fr/img/favicon.png",
        "sizes": "256x256"
    }],
}

标签: jsonmanifestprogressive-web-apps

解决方案


你有没有发现 后面那个杂乱的逗号icons

应该:

{
   "name": "VIDEOFUTUR",
   "short_name": "VF",
   "description": "Télécom",
   "start_url": "index.php",
   "scope": "/",
   "display": "fullscreen",
   "orientation": "any",
   "lang": "French",
   "icons": [
      {
         "src":"https://lafibrevideofutur.fr/img/favicon.png",
         "sizes":"256x256"
      }
   ]
}

下次只需使用任何在线工具验证您的 JSON 。


推荐阅读