shadowwalker / next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰
MIT License
3.89k stars 325 forks source link

Blank page and failed requests #240

Closed AlexTechNoir closed 3 years ago

AlexTechNoir commented 3 years ago

Summary

I recently started to learn PWA, specifically Service Workers. Following the official docs I created next.config.js, copied the basic config code there and launched npm run dev (4 files were successfully generated in public folder). The browser shows blank page, console shows many failed requests. It happens in offline mode.

Versions

How To Reproduce

Steps to reproduce the behavior:

  1. create-next-app and install next-pwa.
  2. Create next.config.js and copy the code from official example.
  3. Launch the app with npm run dev.
  4. Simulate offline mode in Chrome Dev Tools.
  5. See error.

Expected Behaviors

App should work offline.

Screenshots

0

1

2

shadowwalker commented 3 years ago

By default, PWA functionality is limited running in dev mode, this is by design. If you want to see offline working, try running in production mode with next start.