Sam*_*Sam 7 google-chrome visual-studio reactjs asp.net-core manifest.json
I'm building an ASP.NET Core app with ReactJs front-end in Visual Studio 2017.
Recently, I started to notice the missing manifest.json error in the console -- see below. It doesn't seem to effect my app but I do want to get rid of this error.

If I view my app in Edge, I don't see the missing manifest.json error so this error seems to be contained to Chrome only.
I published the app to Azure and again, in Chrome, I'm getting the same error but not in Edge.
知道我该如何解决吗?
Jon*_*ell 17
manifest.json 文件可能位于它应该在的位置。解决方案是在 .json 文件的静态内容部分下的 web.config 文件中添加一个条目。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
如果您需要添加或编辑您的 web.config 文件,您可以使用Kudu 调试控制台来完成。(在链接中将 yourapp 替换为您的应用程序)
如果 manifest.json 文件确实丢失,您可以按照Google 添加 manifest.json 文件的说明进行修复。
Chrome 需要 Web App Manifest 才能在 Web 应用程序中启用“添加到主屏幕”提示。
manifest.json文件/资源本身不存在,最有可能在项目中引用了某个地方。
检查是否有任何link与rel=manifest相似的标签
<link rel="manifest" href="/manifest.webmanifest">
Run Code Online (Sandbox Code Playgroud)
该
.webmanifest扩展名是在规范的“ 媒体类型注册”部分中指定的,但浏览器通常支持带有的其他合适扩展名的清单.json。
即
<link rel="manifest" href="/manifest.json">
Run Code Online (Sandbox Code Playgroud)
并将其从代码中删除以停止错误。
只需添加crossorigin="use-credentials",它看起来像:
<link rel="manifest" href="/site.webmanifest" crossorigin="use-credentials">
| 归档时间: |
|
| 查看次数: |
5339 次 |
| 最近记录: |