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.

`Can not insert an unsupported rule` when using react-jss with dynamic values on chrome

See original GitHub issue

Expected behavior: Using browser targeting CSS like: .button-class::-moz-focus-inner {} together with dynamic values react-jss should apply all rules on chrome.

Describe the bug: When using browser targeting CSS like: .button-class::-moz-focus-inner {} together with dynamic values on react-jss, breaks when using chrome. The console reports Warning: [JSS] Can not insert an unsupported rule... and chrome does not apply the browser targeting rule nor any rules with dynamic values.

You can find the reproduced issue in the Codesandbox below.

When using:

label: {
  fontSize: 16,
},

every rule is applied (including the ::-moz-focus-inner).

However, using:

label: ({ fontSize }) => ({
  fontSize,
}),

chrome does not insert: the ::-moz-focus-inner nor the label rule (or any other dynamically applied rule).

Codesandbox link: https://codesandbox.io/s/m5mzmlk26y

Versions:

  • jss: 10.0.0-alpha.16
  • react-jss: 10.0.0-alpha.16
  • Browser [e.g. chrome, safari]: chrome v73.0.3683.103

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kofcommented, Jun 12, 2019

Duplicate of #1122, is fixed will be released next in the alpha

0reactions
kofcommented, Apr 12, 2019

::-moz-focus-inner is a firefox specific selector, I think we just need to make sure we don’t fail other rules if one rule can’t render, because in this case, that rule wouldn’t do anything in chrome and others anyways, it should justs fail silently like CSS usually does in such cases, without affecting other rules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert a rule right after an unsupported rule will fail · Issue #1122
It will fail because we seem to still increase the index, which will result in something like "Failed to execute 'insertRule' on ...
Read more >
Dynamic Rendering with Rendertron - Google Developers
This blog post shows an example implementation of dynamic rendering using Rendertron, which is an open source solution based on headless Chromium. Which...
Read more >
Accessibility - React
Accessibility support is necessary to allow assistive technology to interpret web pages. React fully supports building accessible websites, often by using ...
Read more >
Handling common JavaScript problems - MDN Web Docs
Note: The easiest solution is to declare the iteration variable with let instead of var —the value of i associated with the function...
Read more >
Service Worker registration error: Unsupported MIME type ...
I use nginx to serve react app and I resolved this issue adding mime types to nginx: ... That's why the mime type...
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