NuxtJS PWA breaks site /_nuxt/ file loading

597 Views Asked by At

On my NuxtJS v2 site I enabled the PWA, sometimes when I load my site, the whole site becomes broken, especially all images do not load in anymore. Looking at the console & network tab, I can see it's getting a 404 on /_nuxt/ javascript files. Console of the site with errors

I do also have a screenshot of my network tab in Chrome. enter image description here

Whenever I disabled the PWA in my nuxt.config.js, this issue seemed to disappear. I tried several things, such as disabling caching /_nuxt/ javascript files in the nuxt.config.js This is my PWA configuration:

  // PWA module configuration: https://go.nuxtjs.dev/pwa
  pwa: {
    manifest: {
      name: 'example.nl',
      short_name: 'Example',
      description: 'Example.nl, example text!',
      lang: 'nl',
      start_url: '/',
      display: 'standalone',
      theme_color: '#000',
      useWebmanifestExtension: false,
      icons: []
    },
    workbox: {
      enabled: false,
      cacheAssets: false, // for /*
      offline: false, // for /_nuxt/*
      cleanupOutdatedCaches: true
    }
  },

As you can see, in the workbox section I disabled every kind of caching, offline mode etc. in the hope that it would fix this, but unfortunately, it didn't fix this issue.

For some time I have tried to fix this issue, and diagnose what is exactly causing this. Yet, I have no exact answer. I hope I can get the answer here!

0

There are 0 best solutions below