hanford / next-offline

make your Next.js application work offline using service workers via Google's workbox
https://github.com/hanford/next-offline
1.59k stars 113 forks source link

Prefetch #278

Closed kaaax0815 closed 3 years ago

kaaax0815 commented 3 years ago

Bug Report🐞

My Issue: Site cannot be installed: Page does not work offline. Starting in Chrome 93, the installability criteria is changing, and this site will not be installable. See https://goo.gle/improved-pwa-offline-detection for more information.

nextConfig:

const nextConfig = {
  future: {
    webpack5: false
  },
  poweredByHeader: false,
  workboxOpts: {
    runtimeCaching: [
      {
        urlPattern: /\.(?:html?)$/,
        handler: 'StaleWhileRevalidate',
        options: {
          cacheName: 'html'
        }
      },
      {
        urlPattern: /\.(?:css|js)$/,
        handler: 'StaleWhileRevalidate',
        options: {
          cacheName: 'assets'
        }
      },
      {
        urlPattern: /\.(?:json)$/,
        handler: 'StaleWhileRevalidate',
        options: {
          cacheName: 'json'
        }
      },
      {
        urlPattern: /\.(?:jpe?g|png|gif|webp|svg|ico)$/,
        handler: 'StaleWhileRevalidate',
        options: {
          cacheName: 'images'
        }
      }
    ]
  }
};

Versions: "next": "10.1.3", "next-offline": "^5.0.3" Browser: Chrome Version 89.0.4389.114 (Official Build) (64-bit) Project: https://github.com/kaaax0815/geis-bus-schedule

Expected:

Workbox precaches the index.html, so when offline -> user has a working page

kaaax0815 commented 3 years ago

additionalManifestEntries: [{ url: 'index.html', revision: '2A99D780840F7DF0A8851084E8AAADBE' }] Will do the trick