NekR / offline-plugin

Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
MIT License
4.52k stars 295 forks source link

I'm getting no internet connection on checked offline in network. #427

Closed mjelecevic closed 5 years ago

mjelecevic commented 5 years ago

Hello,

I'm trying to implement offline-plugin with vue.js but I can't make it work. The offline-plugin is storing the files into the cache but when I check the offline checkbox in the network tab or when I turn off the wi-fi then I'm getting the No internet message. So it won't render it from cache. Do I miss something?

main.js

import * as OfflinePluginRuntime from 'offline-plugin/runtime'

OfflinePluginRuntime.install({
  onUpdateReady: () => {
    // Tells to new SW to take control immediately
    runtime.applyUpdate()
  },
  onUpdated: () => {
    // Reload the webpage to load into the new version
    window.location.reload()
  }
})

webpack.base.conf.js

const OfflinePlugin = require('offline-plugin');

plugins: [
    ...
    new OfflinePlugin({
      ServiceWorker: {
        events: true
      }
    })
  ],
screenshot 2018-11-29 at 16 15 47
rafi16jan commented 5 years ago

@Reollyn I'm also experiencing this issue

GGAlanSmithee commented 5 years ago

@Reollyn

Your information is a bit vauge. Please see the options doc, one of the more advanced examples: 1, 2 or the possibly-related issue #429