question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOMException SecurityError (code 18) checkIfStyleSheetIsImported

See original GitHub issue

react-vis/es/utils/react-utils@checkIfStyleSheetIsImported

checking of importing of react-vis styles via var CSSRulesList = styleSheet.rules || styleSheet.cssRules

it’s better to check via document.styleSheets[i].hasOwnProperty(‘rules’) and document.styleSheets[i].hasOwnProperty(‘cssRules’)

otherwise, the DOMException https://developer.mozilla.org/en-US/docs/Web/API/DOMException SecurityError (code 18) would be in CHROME (windows 10, Version 64.0.3282.167 (Official Build) (64-bit)) if there will be any of <link/> or <style/> tags appended to <head> by other plugins do not have this properties (like, in my case, was https://github.com/tomchentw/react-google-maps, that append to <head> google-fonts <link/>)

for now if fixed it via changing prototype of component where it was used

XYPlot.prototype.componentDidMount = function () { try { checkIfStyleSheetIsImported() } catch (err) { console.warn(err) console.warn('most likely the problem is because of accessing document.styleSheets[i].rules or document.styleSheets[i].cssRules') console.warn('the right way is, e.g., document.styleSheets[i].hasOwnProperty("rules")') } }

but it would be better if you change the react-vis/es/utils/react-utils@checkIfStyleSheetIsImported

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vasymuscommented, Feb 22, 2018

Hi!

Year, sure!

but very busy right now 😦

I think i’ll make the PR at this holidays

Воскресенье, 18 февраля 2018, 23:06 +02:00 от Andrew McNutt notifications@github.com:

Hey @vasymus Thanks for digging into this. I know some other folks have seen similar bugs and this sounds like you have a hold on a solution. I would gladly accept a PR that executed this change. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .

– Vasil Zchdankin6

0reactions
jckrcommented, Mar 15, 2018

@JFernandoGomez I’m going to publish a new version today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught SecurityError: DOMException on iFrame (code 18)
I'm a new to web development, I recently finished my degree and started working for a company as a web developer.
Read more >
DOMException - Web APIs | MDN
The DOMException interface represents an abnormal event (called an ... (Legacy code value: 18 and legacy constant name: SECURITY_ERR ).
Read more >
“SECURITY_ERR: DOM Exception 18” on “iOS9.3 Beta3” Safari
This error occurs when the history.pushState() or history.replaceState() method is called more than 100 times. This error occurs in “iOS9.3 Beta3” Safari, ...
Read more >
Strange DOM Exception 18 Security Error
The error which we got was: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user...
Read more >
Tips for Reducing JavaScript Error Noise | Product Blog • Sentry
That includes code running on your page that isn't necessarily authored or ... code from freed script', /SecurityError\: DOM Exception 18$/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found