【问题标题】:Manifest Line 1, Column 1, Syntax Error when pushed to production清单第 1 行,第 1 列,推送到生产时的语法错误
【发布时间】:2020-03-29 21:42:08
【问题描述】:

首先我搜索了平台和谷歌,但没有运气。

当我推送到生产环境时出现随机清单错误。一推一切都很好。另一个,错误出现。当它出错时,所有图标链接都会中断。我根本想不通。任何帮助表示赞赏。

来自https://zeit.com

直播应用:https://ryancarville.com

回购:https://github.com/ryancarville/portfolio-app

清单代码

{
  "short_name": "Full-Stack-Portfolio",
  "name": "Ryan-Carville-Full-Stack-Portfolio",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "64x64 32x32 24x24 16x16",
      "type": "image/x-icon"
    },
    {
      "src": "/images/bequia-logo.png",
      "type": "image/png",
      "sizes": "204x156"
    },
    {
      "src": "/images/camera.png",
      "type": "image/png",
      "sizes": "340x340"
    },
    {
      "src": "/images/headphones.png",
      "type": "image/png",
      "sizes": "512x512"
    },
    {
      "src": "/images/food.png",
      "type": "image/png",
      "sizes": "512x512"
    },
    {
      "src": "/images/portrait.png",
      "type": "image/png",
      "sizes": "512x512"
    },
    {
      "src": "/images/products.png",
      "type": "image/png",
      "sizes": "512x512"
    },
    {
      "src": "/images/not-found.jpg",
      "type": "image/jpg",
      "sizes": "818x718"
    }
  ],
  "start_url": ".",
  "display": "standalone",
  "theme_color": "#ffffff",
  "background_color": "#ffffff"
}

【问题讨论】:

  • 你解决过这个问题吗?

标签: reactjs manifest


【解决方案1】:

您的 manifast.json 文件看起来不错。 问题出在您的服务器上。当浏览器请求 manifast.json 文件 404 页面作为响应。 这就是语法错误的原因。

【讨论】:

  • 你在哪里看到的?在我的 DevTools Network 选项卡中,清单显示为 200,但出现错误。
  • 检查您的页面,您会发现 尝试打开此链接。此链接应以 json 文件响应,但应以 html 响应。 Html 不是有效的 json,所以第 1 行出现语法错误
  • 啊。好的。将联系服务器提供商。谢谢!这让我发疯了。
猜你喜欢
  • 2020-03-22
  • 1970-01-01
  • 2020-08-06
  • 2019-09-18
  • 2017-09-04
  • 2021-03-27
  • 1970-01-01
  • 2018-03-26
  • 2021-11-22
相关资源
最近更新 更多