Hello,
I'm trying to build an web app using this module and the pwa module. When I try to go offline, the navigator says that he can't fetch the database. Is this a bug, or I miss something or is this impossible ?

You will have data with service worker not just pwa. I am not sure that pwa module is adding a sw.
https://pwa.nuxtjs.org/modules/workbox.html. I am not super use to it but t may help
You will have data with service worker not just pwa. I am not sure that pwa module is adding a sw.
https://pwa.nuxtjs.org/modules/workbox.html. I am not super use to it but t may help
I have workbox which is enable on my project. I will try many thing to understand what is happening
So, I thing I understand something !
As you can see, in production, nuxt will try to fetch a file with the date ! The db file will contains all of your files which are in the content folder.

Buuut, in the service worker storage, the filename doesn't have this, so this fetch return an error when offline.

(offline fetch, cache enable, the first is because of Network first and the second is the sw fetch)
And the interresting thing is that is you remove .concat(Date.now()) (in the dist folder, _static mode enable_) , the offline mode will works.


So here my question, what is the goal of this .concat, in this file (https://github.com/nuxt/content/blob/dev/lib/templates/plugin.static.js)? @Atinux @benjamincanac
The issue was on a new deployment it was not able to fetch the new db.json
One solution could be to use the runtimeConfig and a generation key @benjamincanac
why not to use a hash like images or other content in the build pack ?
Like the pwa-module when the manifest is generated, a hashis added ! The same can be do here no ?

Edit
I think I found something for this issue, try to do a pull request asap !
So, I try to had a hash in the filename but this hash changed during the build process! Why ? because the module is called twice, at the beginning and at the end ! 馃槴 And something change in the db ! But what ? Idon't know.
So I decided to use only the data in the database to create my hash. So if content change, the hash change but during the build process I have th same hash ! Nice ! 馃憣 But not really because the data in the database is not the same in a same build because of the order of load of the file !
So I try to find if I can do something to solve this ! Didn't find how, so I try something else. Try to use the env through the runtimeConfig and the hash of the db, because I need a value which can change at every build but not durint the app is running ! and It works ! PR soon !
