Unfortunately, Deity PWA & Native Storefronts (the frontend app) cannot be used together with NextJs. NextJs uses its own template/routing system, which is incompatible with ours. However, Commerce Composer (data/graphql server app) could be used as a middleware between your backend and your NextJS frontend.
This works differently for Deity PWA & Native Storefronts and Commerce Composer. Configuration information can be found here.
Our service worker, that provides offline support is only used in production mode. If you're running your app in development `yarn start` rather than `yarn start:prod` offline mode won't work.