# Not enough storage is available to complete this operation

**URL:** <https://community.miniprofiler.com/t/not-enough-storage-is-available-to-complete-this-operation/115>\
**Category:** uncategorized\
**Created:** [June 19, 2012, 5:45am UTC](https://community.miniprofiler.com/t/not-enough-storage-is-available-to-complete-this-operation/115 "2012-06-19T05:45:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Mouch](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Josh\_Mouch](https://community.miniprofiler.com/u/Josh_Mouch)\
**Post date:** [June 19, 2012, 5:45am UTC](https://community.miniprofiler.com/t/not-enough-storage-is-available-to-complete-this-operation/115/1 "2012-06-19T05:45:25Z")

</div>

I have a pretty large page that doesn’t load MiniProfiler correctly in IE9 because of a javascript error. This same page loads MiniProfiler fine in Chrome.

The javascript error occurs in the /mini-profiler-resources/includes.js?v=… file.

The error is:  
Not enough storage is available to complete this operation.  
File: includes.js  
Line: 521  
Char: 21

Looking at the javascript, it is trying to create a new StyleSheet to add to the DOM and can’t.

---

<div class="post-metadata">

**Author:** ![Josh\_Mouch](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Josh\_Mouch](https://community.miniprofiler.com/u/Josh_Mouch)\
**Post date:** [July 26, 2012, 5:01am UTC](https://community.miniprofiler.com/t/not-enough-storage-is-available-to-complete-this-operation/115/2 "2012-07-26T05:01:53Z")

</div>

I’ve looked into this a little more, and I think the error is due to an IE “bug” that doesn’t allow createStyelSheet to be used after there are 31 css references on a page. For reference: [http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx](http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx)

So I think the fix would be to:

1. Add the style sheet a different way  
or
2. Handle this exception and when it occurs, fallback to using the workaround discussed in the article. In other words, instead of:

document.createStyleSheet(‘styles.css’);

use:

var styleSheet = document.createElement(‘STYLE’);  
document.documentElement.firstChild.appendChild(styleSheet);
