-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Milestone
Description
After updating PWA plugin from version 0.3 to 0.4 or 0.5, the following error is thrown in the console during a SW installation:
wp_service_worker=1:411 Uncaught TypeError: wp.serviceWorker.routing.registerNavigationRoute is not a function
at ?wp_service_worker=1:411
at ?wp_service_worker=1:477
It seems that the way the navigation route is registered is no longer supported in Workbox 5.
The SW is successfully installed with the following change:
- wp.serviceWorker.routing.registerNavigationRoute(
- navigationRouteEntry.url,
- {
- denylist,
- }
- );
+ wp.serviceWorker.routing.registerRoute(
+ new wp.serviceWorker.routing.NavigationRoute(
+ wp.serviceWorker.precaching.createHandlerBoundToURL(
+ navigationRouteEntry.url
+ ),
+ {
+ denylist,
+ }
+ )
+ );Reactions are currently unavailable