When setting dynamicStartUrl: true option, the new installability check in Chrome 89 disappeared, visitting start-url got redirected correctly as intended. But when I tried to visit the start-url again after the first redirection, it won't open the page and chrome's offline page was shown instead.
Chrome's DevTool also show this warning
The FetchEvent for "http://localhost:3000/" resulted in a network error response: a redirected response was used for a request whose redirect mode is not "follow".
Promise.then (async)
(anonymous) @ Router.js:58
I've created a minimal repro here: https://github.com/panjiesw/pwa-repro with this next.js.config
const withPWA = require('next-pwa');
module.exports = withPWA({
pwa: {
dest: 'public',
dynamicStartUrl: true,
},
});
Steps to reproduce the behavior:
yarn dev (or yarn build then yarn start)Users should still be able to re-visit start-url after they got redirected when using dynamicStartUrl instead of shown Chrome's offline page.
Chrome DevTool warning:

Chrome offline page:

My PWA require a redirection from start-url (/) to a login page if not authenticated (handled server side in Next.js). Before, the PWA got Chrome's warning that it won't be installable in Chrome 93 onwards, so I'm trying dynamicStartUrl feature in next-pwa.
Update: Seems like it's also causing error in Firefox


Update Environment:
v14.5.4v10.1.3v5.2.3Update: found a response for your workaround here: https://github.com/GoogleChrome/workbox/issues/2749#issuecomment-813489953, do you suggest to not enable dynamicStartUrl for now? Since the offline check likely will get improvement in Chrome anyway
I'm seeing a similiar issue on iOS Safari 12-14.x with next-pwa v5.1.4. Looks like dynamicStartUrl became the default in https://github.com/shadowwalker/next-pwa/commit/c6416215bcdec6cc49540259f47863f14ea8f39d
FetchEvent.respondWith received an error: no-response: no-response :: [{"url": ...
Try version 5.2.4 and config this option:
https://github.com/shadowwalker/next-pwa/blob/a15c9f612787edef125426a049b841ecc12b26c9/examples/cookie/next.config.js#L7
@shadowwalker thanks using dynamicStartUrlRedirect works! But seems like there is console.log statement here https://github.com/shadowwalker/next-pwa/blob/f9955c26dbd092e262f457a20bc9a2f46295fd03/register.js#L5
Is that a left over from development or an intended one? It's shown even in production build.
Version 5.2.7 should fix this problem.
Sorry for not getting back sooner. I've confirmed that the issue has been fixed using latest version, thanks @shadowwalker!