Closed asrashley closed 10 years ago
Thanks for the feedback! This is now fixed on master of JSS and will make its way into version 0.7.
We're now reading the sheet directly from the DOM node, so there's no need to update the sheets variable for the _nodeToSheet function to work properly, yay :)
I am finding a null dereference exception is being triggered when using jss with Chrome 12.0. In jss._getRules, the error is on the line "if (typeof sheet.length == 'number') {" where sheet is null.
Having done some digging, it appears to be that when jss._addSheet is called (to add an extra sheet to store the new rules) document.styleSheets does not get updated directly after the head.appendChild(styleNode). This causes the jss._nodeToSheet function to fail to find the newly created sheet.
My solution (hack?) was to add some code after the appendChild to look in the DOM for the stylesheets and update the sheets variable accordingly:
I'm sure there are more elegant solutions, but this got me out of my problem.