Skip to content

QUOTA_EXCEEDED_ERR: DOM Exception 22 with client-side Less #312

Open

Description

@greghouston

In Firefox, Internet Explorer, and Chrome I regularly get the following error displayed at the top of my pages using client-side Less CSS.

QUOTA_EXCEEDED_ERR: DOM Exception 22
http://192.168.0.174:8000/static/css/dbe8f87e058b.css

In Firefox this error appears less frequently, but instead makes the browser window go black instead of displaying the error message. The browser has to be restarted at this point. Memory usage in Firefox is usually at about 2.6GB when this occurs, which is amazingly high. Chrome does not have the same memory issue, but still displays the above error on the pages.

Activity

  1. greghouston commented on Jul 15, 2011

    @greghouston
    Author

    This is an error that occurs when the Web Storage Quota is exceeded. Clearing browsing data in the browser will remove the error ... until the quota is exceeded once again. The more changes that are made to the CSS, the sooner the quota seems to be exceeded.

  2. taivu commented on Oct 10, 2011

    @taivu

    i get the same error on the ipad with a medium sized .less file, but resetting the cache through settings doesnt get rid of the error.

  3. ttfkam commented on Oct 10, 2011

    @ttfkam
    Contributor

    As @greghouston points out, the expiry of older CSS builds is an issue.

    I am curious about the 2.6GB of memory usage and how Less could cause that kind of memory leak from page to page. Unless you were calling less.refresh() over and over on the same page -- though again, I don't know of any specific bug about that -- I am very curious as to how this is happening.

  4. taivu commented on Oct 11, 2011

    @taivu

    i was making changes to the .less file and saving. then refreshing on the ipad. Im not sure if thats a less.refresh() or not.

  5. Fresheyeball commented on Dec 2, 2011

    @Fresheyeball

    This may be a side note. But I just noticed the error goes away if I leave private browsing on the iPad.

  6. ttfkam commented on Dec 3, 2011

    @ttfkam
    Contributor

    @Fresheyeball: That makes sense since private browsing always starts with a clean slate and leaves nothing behind. That would be try on any browser on mobile or desktop that supports private browsing.

  7. Fresheyeball commented on Dec 3, 2011

    @Fresheyeball

    @ttfkam totally. I just wanted to make mention in-case it helps anyone.

  8. tkane2000 commented on Jan 25, 2012

    @tkane2000

    Does it seem weird to anyone that the error mentions the ".css" or the ".less" file instead of the LESS js file (such as less-1.2.1.min.js)? The CSS/LESS shouldn't do anything except get compiled by the js. Maybe it's a bug in which the browser is trying to render the LESS code as CSS?

    I suppose the ultimate answer is to just compile it on the server side.

  9. pgdesjardins commented on Jun 7, 2012

    @pgdesjardins

    I concur with @Fresheyeball
    Turning off private browsing solves the issue on iphone 4s.
    Incognito window on Chrome do not have this issue.

  10. Fresheyeball commented on Jun 7, 2012

    @Fresheyeball

    @pgdesjardins Just for the record, I am now firmly against using in browser less rendering. We should always be doing it with preprocess and sending rendered css to the browser instead. With new tools like 'codekit' there is really no excuse.

  11. pgdesjardins commented on Jun 7, 2012

    @pgdesjardins

    @Fresheyeball
    I totally agree with you... I usually run dotless (for .net) or winless on my desktop.
    I was testing a prototype on mobile browsers.

  12. sym3tri commented on Aug 17, 2012

    @sym3tri

    +1
    getting this too

  13. lukeapage commented on Sep 2, 2012

    @lukeapage
    Member

    Added try-catch to at least stop throwing an error. Could do with working out good cache policy - clearing/removing items instead of always adding them.

  14. Fresheyeball commented on Oct 26, 2012

    @Fresheyeball

    @agatronic the value that less provides is not worth risking it, or having to implement a separate error management scheme. Just pre-process and be done with it.

  15. lukeapage commented on Oct 28, 2012

    @lukeapage
    Member

    good point.. +1 to remove caching

  16. ZetIsDeadBaby commented on Oct 30, 2012

    @ZetIsDeadBaby

    This partly helps, not working for IE9

    function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/'
        if (!window.localStorage || !less || less.env !== 'development') {
            return;
        }
        var host = window.location.host;
        var protocol = window.location.protocol;
        var keyPrefix = protocol + '//' + host + pathToCss;
    
        for (var key in window.localStorage) {
            if (key.indexOf(keyPrefix) === 0) {
                delete window.localStorage[key];
            }
        }
    }
  17. infernoboy commented on Dec 31, 2014

    @infernoboy

    Not sure if it's relevant here, but the quota issue occurs within Safari extensions also. LESS files from within an extension are re-cached every time the extension is reloaded. This is because the extension URL always changes to ensure it is unpredictable (e.g. safari-extension://JSB5/bed9d148/, where the last part changes every reload) A way to disable the localStorage caching would be greatly beneficial for this case as the files are always local anyway.

  18. matthew-dean commented on Mar 4, 2016

    @matthew-dean
    Member

    I'm confused how this issue was happening in the first place. A compiled CSS file shouldn't exceed any localstorage limits for a particular domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions