gpt4 book ai didi

google-chrome-devtools - jekyll + service worker 失败 : service worker does not successfully serve the manifest's start_url

转载 作者:行者123 更新时间:2023-12-04 23:44:00 24 4
gpt4 key购买 nike

无法为 jekyll 驱动的项目站点设置 Service Worker,灯塔 拒绝 start_url值并给出错误 Unable to fetch start URL via service worker
app->manifest输出显示根 /
试过 ./index.html以及 - 相同的结果。有没有办法通过审核?

list .json:

{
"name": "outcast",
"short_name": "outcast",
"icons": [
{
"src": "/assets/images/splsh192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/assets/images/splsh512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"lang": "en-US",
"display": "standalone",
"background_color": "#131313",
"theme_color": "#f62e1a",
"start_url": "/",
"serviceworker": {
"src": "sw.js",
"scope": "/",
"update_via_cache": "none"
}
}

sw.js

最佳答案

更换 fetch处理程序在 sw.js使用官方指南中的代码修复了该问题。仍在调试未定义的缓存

self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
// Cache hit - return response
if (response) {
return response;
}
return fetch(event.request);
}
)
);
});

关于google-chrome-devtools - jekyll + service worker 失败 : service worker does not successfully serve the manifest's start_url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50710520/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com