shadowwalker / next-pwa

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

URI fragments (`/#hash`) don't work offline #465

Open joliss opened 1 year ago

joliss commented 1 year ago

Summary

If I open a fragment URL (/#foo) while offline, I get an error page rather than a response from the service worker, even though the base URL (/) works fine offline.

Our workaround has been to pass fallbacks: { document: "/" } as an option.

I just wanted to check if this is intended behavior at all?

(I found a related old issue on workbox that might be of interest: https://github.com/GoogleChrome/workbox/issues/488)

Configuration

const withPWA = nextPWA({ dest: "public", disable: false, reloadOnOnline: false });

Versions