question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StaleWhileRevalidate throws transient error when opening developer tools after a clean cache

See original GitHub issue

Library Affected: workbox-strategies@4.3.1 and workbox-strategies@5.1.3 (that’s all I’ve checked)

Browser & Platform: Chrome Desktop Version 83.0.4103.97 (Official Build) (64-bit)

Issue Description: We are seeing an error that only manifests when the chrome developer console is opened after site data has been cleared and the page refreshed.

To reproduce the bug:

  1. Go here: http://develop.pwa-venia.com/
  2. Open console and clear site data
  3. Refresh the page
  4. Close and reopen the dev console. You should see the error:

Image from Gyazo

Further investigation showed this to be the same error from this stack overflow post and this github issue. So I’m opening this issue to see if ya’ll would be open to a contribution to the StaleWhileRevalidate code.

I was able to prevent the error from being thrown by adding code to the _getFromNetwork function:

    async _getFromNetwork({ request, event }) {
        if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
            return;
        }
        ...
     }

I also understand that this could be an old chromium issue but that issue has been marked as fixed and it wasn’t clear to me why or how.

Open to discussing alternatives. Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jeffposnickcommented, Jun 19, 2020

I don’t feel great about adding in code to workbox-strategies to work around those “phantom” requests that DevTools initiates.

I’ve reopened https://bugs.chromium.org/p/chromium/issues/detail?id=823392#c34 and I think that’s the place to follow up.

0reactions
jeffposnickcommented, Jun 19, 2020

No, I think it’s just a side-effect of something in the DevTools codebase, and isn’t something that would be documented one way or another.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bizarre Error in Chrome Developer Console - Failed to load ...
When I close the Developer Tools window and then open up the window without a page reload, the number of errors increments by...
Read more >
Issues: Find and fix problems - Chrome Developers
The Open Issues button with a red icon. Alternatively, select Issues from the More tools menu. The Issues tab in More tools menu....
Read more >
Google Chrome Developer Tools Crash Course - YouTube
In this video we will be taking an intermediate look at the Google Developer Tools. You will learn how to do things such...
Read more >
How to open and use developer console in browsers (Сhrome ...
Elfsight guide: learn how to open Developer Tools in any browser you use + How to find and iterpret the most common errors...
Read more >
Is there a way to clear the cache for a particular domain
Clear cache using either browser menu or Developer Tools Network Panel context menu ... to see indications of JS errors without opening devtools....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found