You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
QUOTA_EXCEEDED_ERR: DOM Exception 22 with client-side Less #312
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.
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.
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.
@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.
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.
@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.
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.
@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.
functiondestroyLessCache(pathToCss){// e.g. '/css/' or '/stylesheets/'if(!window.localStorage||!less||less.env!=='development'){return;}varhost=window.location.host;varprotocol=window.location.protocol;varkeyPrefix=protocol+'//'+host+pathToCss;for(varkeyinwindow.localStorage){if(key.indexOf(keyPrefix)===0){deletewindow.localStorage[key];}}}
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.
Activity
greghouston commentedon Jul 15, 2011
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.
taivu commentedon Oct 10, 2011
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.
ttfkam commentedon Oct 10, 2011
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.
taivu commentedon Oct 11, 2011
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.
Fresheyeball commentedon Dec 2, 2011
This may be a side note. But I just noticed the error goes away if I leave private browsing on the iPad.
ttfkam commentedon Dec 3, 2011
@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.
Fresheyeball commentedon Dec 3, 2011
@ttfkam totally. I just wanted to make mention in-case it helps anyone.
tkane2000 commentedon Jan 25, 2012
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.
pgdesjardins commentedon Jun 7, 2012
I concur with @Fresheyeball
Turning off private browsing solves the issue on iphone 4s.
Incognito window on Chrome do not have this issue.
Fresheyeball commentedon Jun 7, 2012
@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.
pgdesjardins commentedon Jun 7, 2012
@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.
sym3tri commentedon Aug 17, 2012
+1
getting this too
lukeapage commentedon Sep 2, 2012
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.
Fresheyeball commentedon Oct 26, 2012
@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.
lukeapage commentedon Oct 28, 2012
good point.. +1 to remove caching
ZetIsDeadBaby commentedon Oct 30, 2012
This partly helps, not working for IE9
infernoboy commentedon Dec 31, 2014
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.
matthew-dean commentedon Mar 4, 2016
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.