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.

Firefox: InvalidAccessError when checking if stylesheet has been imported

See original GitHub issue

After having tweaked my build system I get an error in Firefox only: “InvalidAccessError: A parameter or an operation is not supported by the underlying object”.

The error is related to react-utils.js line 99:

var styleSheet = document.styleSheets[i];
var CSSRulesList = styleSheet.rules || styleSheet.cssRules;

Trying to access styleSheet.cssRules makes Firefox crash; uncommenting this line (and the next ones) fixes the problem.

The error is probably rare, because it’s all about timing, e.g. if you set a breakpoint at the mentioned line you won’t get the error. So it only happens if you load a chart as one of the first things of your app. In my case the app is just being build…

So it’s probably more of an edge case. However, the code in question only tries to warn the user.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
texttechnecommented, Dec 13, 2017

To be honest I would just remove the check / warning, because you cannot reliably determine from JS if the user just forgot to include styles:

  • As mentioned in this issue, there are circumstances where the test itself will fail
  • then there are use cases of custom style imports #683
  • or even completely custom styling

Do you have so much pain with users that don’t realize that they’ve missed to include the css?

0reactions
mcnuttandrewcommented, Dec 13, 2017

Well that’s no good. I would support an additional PR that marks the check unnessecary via localstorage or a prop on XYPlot called noStylesheetCheck that disables the check if that floats your boat

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Firefox - Unable to query cssRules if @import is ...
I am unable to query cssRules if @import is present in css stylesheet. Is it expected as per web standard? Or it's know...
Read more >
Firefox won't load CSS for local website - Mozilla Support
My site loads perfectly fine in other browser, just not Firefox. I have a local website with a style sheet that is saved...
Read more >
Mozilla Firefox Release Notes
786891, Add capability to auto-prefix modules to python script that imports css reftests. 803276, Disable typed array move() operator for specific channels.
Read more >
DOMException - Web APIs | MDN
Each exception has a name, which is a short "PascalCase"-style string identifying the error or abnormal condition.
Read more >
Firefox doesn't load CSS file - Mozilla Support
If i go to the developer console it give me this error (translated): <The character encoding of the HTML document has not been...
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