mdn / dom-examples

Code examples that accompany various MDN DOM and Web API documentation pages
https://developer.mozilla.org/en-US/docs/Web/API
Creative Commons Zero v1.0 Universal
3.4k stars 1.79k forks source link

Chrome console error using default demo #145

Open 892206 opened 2 years ago

892206 commented 2 years ago

Example: service-worker/simple-service-worker

I tried the demo and got the following error after couple of refreshes:

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.

and as second error:

Uncaught (in promise) DOMException: 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.

after I watched the github demo I saw the same problem. How could this be resolved?

schalkneethling commented 2 years ago

Hey @892206! Thank you for opening this issue. We are combining some of our repositories to enable us to triage pull requests and issues more effectively. Therefore, this specific repository will be merged into the more prominent dom-examples repository. I will transfer this issue to this new repo for further discussion.

SystemDisc commented 1 year ago

I am also getting this error.

pepelsbey commented 10 months ago

I was able to reproduce the error:

  1. Check out git@github.com:mdn/dom-examples.git
  2. Go to the example: cd service-worker/simple-service-worker
  3. Start local server npx lite-server
  4. Open demo in Chrome
  5. Check console for errors (empty)
  6. Wait a bit, reload a few times:

Image

There’s also another one:

Failed to execute 'put' on 'Cache': Request method 'POST' is unsupported

sidewayss commented 7 months ago

This is a Chrome bug filed last March: https://bugs.chromium.org/p/chromium/issues/detail?id=1420515 Not even assigned yet, so don't hold your breath for a fix. And don't bother trying to fix this demo app.

I opened a PR to add a comment about this bug in the code: https://github.com/mdn/dom-examples/pull/253.