-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser alerts that Manifest start_url is not cached #125
Comments
👍 sw-precache-webpack-plugin version: Environment: Browser: |
I got the same issue, with Chrome's Canary Lighthouse audit. On other side with standard chrome I do not have this errors, and my app installing to Android desktop as usual, so I have pretty high degree of confidence that it is a Chrome's bug. |
Testing on Lighthouse keeps pointing to the same error, "does not respond with 200 when offline" and "user will not be prompted to install web app". But after deployment and testing on Android, it does ask to install (only once, as stated in Chrome docs), but it indeed doesn't work offline. Not sure if it's a Chrome or ServiceWorker bug. |
If self.addEventListener('install', function(event) {
const CACHE_NAME = 'startup-v2';
console.log('install: ' + CACHE_NAME);
const urls = [
'/'
];
event.waitUntil(
caches.open(CACHE_NAME).then(function(cache) {
return cache.addAll(urls);
})
);
}); How do I achieve the above with SW Precache Webpack Plugin? (since service-worker.js is generated by the plugin) |
It is Lighthouse bug in Canary Chrome. If you test with standard chrome,
you'll see that it is not failing there, and if you test it on real android
device, you'll see that it behaves correct.
2018-02-04 17:45 GMT+08:00 luaz <[email protected]>:
… If "start_url": "/", I usually just need use following code in
service-worker.js to pass the lighthouse requirement of Failures: Service
worker does not successfully server the manifest's start_url
self.addEventListener('install', function(event) {
const CACHE_NAME = 'startup-v2';
console.log('install: ' + CACHE_NAME);
const urls = [
'/'
];
event.waitUntil(
caches.open(CACHE_NAME).then(function(cache) {
return cache.addAll(urls);
})
);
});
How do I achieve the above with SW Precache Webpack Plugin? (since
service-worker.js is generated by the plugin)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACJseW3o3dFqoMIp6egz2clH0OW_QbIWks5tRXw_gaJpZM4Qp0ri>
.
|
I test it on Chrome 64 on Linux and is still getting the warning (stable, not canary). The warning aside, how to add external assets (non-webpack assets) or urls to be cached by sw-precache-webpack-plugin? I am pretty new to PWA, so I might get the concept wrong here. I use the following configuration as it will cache all js, css and html generated in webpack. What should I do if I want the service worker to cache some external resources (e.g. "/", or "/app" or "/data.json") which is not part of this webpack? new SWPrecacheWebpackPlugin({
cacheId: 'test',
filename: 'service-worker.js',
staticFileGlobs: ['dist/**/*.{js,css,html}', '/'],
// minify: true,
stripPrefix: 'dist/'
}) |
@JustFly1984 no, not really. I never tested on Canary or Chromium, always on stable Chrome releases. All stated problems are originated from it. Also, as I said, it does prompt the user to install the PWA, but it doesn't work offline. |
Oh, my stable chrome is 63 version. Can you confirm if you have new option SEO in your Audit LightHouse, if i you have SEO, so it mean this bug went unfixed from Canary to Stable. |
My Chrome stable version is 64.0.3282.119, though I don't see the SEO option. Yet, here are the results I have when running the audits: Remember, as I said, the user is prompted to install the web app, it just doesn't work offline. My |
Have same issue |
1 similar comment
Have same issue |
webpack version:
3.8.1
sw-precache-webpack-plugin version:
0.11.4
Please tell us about your environment:
Linux Ubuntu 17.10 and Windows 10
Browser: Chrome 62.0.3202.94 (64 bits)
Current behavior:
The
sw.js
gets generated correctly and all static assets are being cached as expected but other requests (such as specifiedstart_url
inmanifest.json
) are not, so after looking at a Lighthouse report within Chrome, it points to that error.Expected/desired behavior:
Other requests should be cached as well as the static assets.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with your:
Not sure if it is a bug or I'm doing something wrong.
Probably same problem as #114 but it had no code samples or descriptions, so I figured I'd make a new one.
The text was updated successfully, but these errors were encountered: