next-pwa not generating service worker files

471 Views Asked by At

I have a project with react.js and next.js, and now I'm trying to convert it to PWA app, using next-pwa.

I do every thing based on pwa-next docs, and when I run npm run build, it doesn't generate any workbox-*.js and sw.js files.

The next.js version is 13.4, and I'm using page routing directory. And the next-pwa version is 5.6.0.

What is the problem with it?

1

There are 1 best solutions below

0
On

Try downgrading the nest-pwa version to 5.4.0, the run "yarn" or "npm i" and rebuild if still the same, remove the "^" in the package.json file so you only have "next-pwa": "5.5.4",, run yarn or npm i, and rebuild. it should resolve it.