清单行 1,列 1,推送到生产环境时的语法错误



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

当我推送到生产环境时出现随机清单错误。 只需按一下,一切都很好。 对于另一个,会出现错误。 当它出错时,所有图标链接都会断开。 我根本想不通。 任何帮助,不胜感激。

供应 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"
}

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

我遇到了同样的问题,它解决了。在我的应用程序中.js快速后端文件夹我错误地放置了索引.html文件

(app.use(express.static(path.join(__dirname,"../frontend/build/index.html")))

所以在删除其工作正常之后。代码应如下所示

if (process.env.NODE_ENV === 'development') { app.use(express.static(path.join(__dirname,"../frontend/build")));
app.get("*", (req, res) => { res.sendFile(path.resolve(__dirname,"../frontend/build/index.html")); }); }

最新更新