You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing an issue where navigating to a precached route (using workbox.precacheAndRoute()) will fail and display the navigateFallback if there is a single ? without any URL parameters at the end.
That is, navigating to /some/page will work, but navigating to /some/page? will show the 404 page (navigateFallback).
I found that setting ignoreURLParametersMatching to [/.*/] (i.e. ignore all URL parameters) solves this issue. However, this is awkward. There are no actual URL parameters here, so the only way to match this case is to ignore all URL parameters. It's impossible to only match this case (? without any parameters), but not match actual parameters, or only match some parameters as far as I can tell.
Edit: Actually, looks like setting this option doesn't work at all, I'm still getting a 404 page.
Library Affected:
workbox-precaching, workbox-build
Browser & Platform:
All browsers
Issue or Feature Request Description:
Arguably, an empty query (only a ? at the end of the URL with nothing else) should match precached pages by default. If this isn't possible or there's some edge-case I'm not seeing, it should be possible to configure ignoreURLParametersMatching in a way that allows this case to match the precached route, but not other URL parameters.
I'm using generateSW right now. Happy to switch to injectManifest to address this. Looks like urlManipulation is the option I'm looking for? As far as I can tell this isn't available with generateSW. Still, the default behavior could be improved here.
The text was updated successfully, but these errors were encountered:
I'm seeing an issue where navigating to a precached route (using
workbox.precacheAndRoute()
) will fail and display thenavigateFallback
if there is a single?
without any URL parameters at the end.That is, navigating to
/some/page
will work, but navigating to/some/page?
will show the 404 page (navigateFallback
).I found that setting
ignoreURLParametersMatching
to[/.*/]
(i.e. ignore all URL parameters) solves this issue. However, this is awkward. There are no actual URL parameters here, so the only way to match this case is to ignore all URL parameters. It's impossible to only match this case (?
without any parameters), but not match actual parameters, or only match some parameters as far as I can tell.Edit: Actually, looks like setting this option doesn't work at all, I'm still getting a 404 page.
Library Affected:
Browser & Platform:
All browsers
Issue or Feature Request Description:
Arguably, an empty query (only a
?
at the end of the URL with nothing else) should match precached pages by default. If this isn't possible or there's some edge-case I'm not seeing, it should be possible to configureignoreURLParametersMatching
in a way that allows this case to match the precached route, but not other URL parameters.I'm using
generateSW
right now. Happy to switch toinjectManifest
to address this. Looks likeurlManipulation
is the option I'm looking for? As far as I can tell this isn't available withgenerateSW
. Still, the default behavior could be improved here.The text was updated successfully, but these errors were encountered: