Skip to content

The service worker navigation preload request was cancelled before 'preloadResponse' settled #2178

@kevmittal

Description

@kevmittal

Library Affected:
workbox-navigation-preload (4.3.1)

Browser & Platform:
Google Chrome 75.0.3770.142 on macOS 10.14.6

Error Description:

When using workbox.navigationPreload.enable(), it throws this error in the console.

The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle.

service-worker.js:

workbox.navigationPreload.enable()

var route = new workbox.routing.NavigationRoute(new workbox.strategies.StaleWhileRevalidate({
  cacheName: 'test',
  plugins: [
    new workbox.expiration.Plugin({
      maxEntries: 1
    })
  ]
})

workbox.routing.registerRoute(route)

Am I doing anything wrong?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions