One of the main benefits of a PWA is that all URLs respond with a 200 and a working app shell.
In an ideal scenario a nextjs PWA would respond with an app-shell which could be created by a user by accessing something like /pages/_app-shell.js (which can have 'blank' default like _404 is)
When a user accesses a random URL it will always return the contents of _app-shell.js. The client app will navigate to the page if the user is online, if the user is offline offline it wont and it will show a 'you are offline message'.
I think what you are looking for is navigateFallback in workbox config
https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-webpack-plugin.GenerateSW#GenerateSW
Feel free to pass this config into pwa object in next.config.js
Isn't this something that would be in the scope of next-pwa to support in the plugin its self?
Currently the plugin is purely a service worker implementation. Maybe that is the goal, but that contradics the 'Zero Config PWA Plugin for Next.js' slogan ;)
@paales yes! I agree too. Basic pwa checklist fails if this case is not handled.
Most helpful comment
Isn't this something that would be in the scope of next-pwa to support in the plugin its self?
Currently the plugin is purely a service worker implementation. Maybe that is the goal, but that contradics the 'Zero Config PWA Plugin for Next.js' slogan ;)