您好,我将react / express项目推送到heroku(https://polar-oasis-57801.herokuapp.com/),并在控制台中收到以下错误:
Chrome console error messages
我尝试查找此错误,似乎我需要更改manifest.json文件中的某些内容,但不确定.任何建议都会有所帮助.这是我的清单文件:
{
"short_name": "React App","name": "Create React App Sample","icons": [
{
"src": "favicon.ico","sizes": "64x64 32x32 24x24 16x16","type": "image/x-icon"
}
],"start_url": ".","display": "standalone","theme_color": "#000000","background_color": "#ffffff"
}
还有我在Github上的项目:https://github.com/bernar83/cat-cards
最佳答案
此错误意味着对manifest.json的请求未返回有效的JSON响应.考虑到由于开始<而失败,它可能返回HTML.
确保正确链接manifest.json,并确保在部署过程中保持其完整性.尝试导航到http://yoururl/manifest.json并检查结果.
EDIT1:看来您到清单的链接已损坏.在https://github.com/bernar83/cat-cards/blob/master/client/public/index.html中,尝试更换
原文链接:https://www.f2er.com/js/531219.html<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
与
<link rel="manifest" href="manifest.json" />
EDIT2:只需检查您的Heroku链接即可确认错误.您的页面尝试在错误的/cat-cards/manifest.json路径下找到manifest.json.它只能是manifest.json