shadowwalker / next-pwa

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

unavailable service worker for start_url when using basePath #393

Closed huaxiaocheng closed 1 year ago

huaxiaocheng commented 1 year ago

Summary

unavailable service worker for start_url when using basePath

Versions

How To Reproduce

Steps to reproduce the behavior:

  1. next.config.js set basePath: "/hello"(basePath cannot end with "/" so it cannot be "/hello/")
  2. _app.tsx set <link rel="manifest" href="/hello/manifest.json" />
  3. if manifest.json set start_url: "/hello", installable line will prompt "No matching service worker detected" and service worker does not work
  4. if manifest.json set start_url: "/hello/", no prompt but service worker does not work either

Expected Behaviors

refresh "localhost:3000/hello", use service work cache

huaxiaocheng commented 1 year ago

https://github.com/shadowwalker/next-pwa/issues/305