epicmaxco / epic-spinners

Easy to use css spinners collection with Vue.js integration
https://epic-spinners.epicmax.co
3.84k stars 357 forks source link

"SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules" #24

Closed BenAHammond closed 5 years ago

BenAHammond commented 5 years ago

The "SpringSpinner" appears to be trying, and failing, to access a stylesheet on the document and the result are ugly JS errors on load.

The offending code seems to be inside of the SpringSpinner:

appendKeyframes: function (name, frames) {
    var idx = document.styleSheets[0].cssRules.length
    document.styleSheets[0].insertRule('@keyframes ' + name + ' { ' + frames + ' }', idx)
  }
vue.runtime.esm.js?2b0e:601 [Vue warn]: Error in mounted hook: "SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules"

found in

---> <SpringSpinner> at node_modules/epic-spinners/src/components/lib/SpringSpinner.vue
seb-vial commented 5 years ago

Same issue here

ciryon commented 5 years ago

Also here. I had a working component with an epic spinner than suddenly once I started working on some new features in the component, unrelated to the spinner, and this error pops up.