Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) DOMException: Quota exceeded. sw.js #3165

Closed
RobertBolender opened this issue Dec 8, 2017 · 11 comments
Closed

Uncaught (in promise) DOMException: Quota exceeded. sw.js #3165

RobertBolender opened this issue Dec 8, 2017 · 11 comments

Comments

@RobertBolender
Copy link
Contributor

Site: https://www.gatsbyjs.org/
Browser: Chrome Version 62.0.3202.94 (Official Build) (64-bit)
OS: Ubuntu 16.04.3 LTS

I've noticed some issues with the https://www.gatsbyjs.org/ site, and am getting numerous errors in the console log:

screenshot_1512753349

When I get these errors, links stop functioning until I hard refresh my browser. After visiting a few more pages, the error returns.

I suspect that it has something to do with pre-fetching data on pages with lots of links.

I'm not overly familiar with service workers, but I'm hoping that there would be a way to handle this exception and fallback to loading data normally when the service worker quota is reached.

@ratikanta131
Copy link

@awesomebob This error is because you have low memory space on your operating system installed drive. Empty some space, this will work. I am also stuck in this error. Trying to handle it.

@kevinsalerno
Copy link

You're storing too much data in the allowed browser cache for the service worker.

See this:
ilan-schemoul/meteor-service-worker#6

Ignore Ratikanta's answer.

@RobertBolender
Copy link
Contributor Author

This is happening on gatsbyjs.org, so I would think that the Gatsby project would benefit from catching this error and handling it instead of just letting site navigation break.

@nicholaai
Copy link

+1

@m-allanson
Copy link
Contributor

@awesomebob and @nicholaai I'm unable to replicate this on macOS with Chrome v64.0.3282.186.

What output do you get if you go to gatsbyjs.org and paste the following into Chrome's console?

navigator.webkitTemporaryStorage.queryUsageAndQuota(
  (bytesUsed, bytesRemaining) => {
    console.log("bytes used", bytesUsed);
    console.log("bytes left", bytesRemaining);
  },
  e => { console.log(e) }
);

Alternatively the Application tab in Chrome's dev tools will give you similar info:

screen shot 2018-02-28 at 11 14 02

@RobertBolender
Copy link
Contributor Author

I'm not able to reproduce the problem currently either.

bytes used 64597200
bytes left 2199497117

This might have been fixed recently?

@nicholaai
Copy link

I had this happen on my own project, not on the gatsby.org website. Apologies for not being more specific. Oddly enough, the problem self-resolved after some more refreshes & opening new incognito windows.

@KyleAMathews
Copy link
Contributor

fwiw, my understanding of incognito windows is that they load everything into RAM so have lower limits on SW and other browser caches which means you'll run into errors you normally won't.

@m-allanson
Copy link
Contributor

I'm going to close this as I don't think there's anything Gatsby can do here. Please re-open if that's wrong!

@civility-bot
Copy link

This quota issue happens due to caching opaque responses, which for security reasons, must be padded to very large sizes (minimum 7MB).

We're also running into it on our home page, likely due to Workbox caching external resources. Relevant Workbox bug.

Something that Gatsby could do here is to set defaults for gatsby-plugin-offline to not cache external resource due to this bug.

@stonehz
Copy link

stonehz commented Jun 22, 2020

Is there a method we can exclude opaque requests ? looking into https://www.gatsbyjs.org/docs/browser-apis/#onServiceWorkerRedundant
or https://www.gatsbyjs.org/docs/browser-apis/#onServiceWorkerActive but not sure what which API allows us to add the suggested logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants