-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StyleSheetRegistry errors #319
Comments
I am also facing this issue in production, does anybody know a quick fix for now please? |
The quick fix is to not use the @slaskis why would you use an empty style tag? |
I found some empty @giuseppeg Thanks anyway. |
I just updated next to 4 and this started to happen in production. I don't know why but a colleague of mine does it kind of like a template for new components which will get styles later. I would understand if it's not supported but a better and maybe more consistent error would be nice. Now it's a pretty aggressive regression which occur when you upgrade. |
yup we could filter out empty rules of course :) PR are welcome! |
jsx-2085888330
not found.
FYI beginning work on this, wish me luck 😂 🎃 💩 |
@slaskis Could this be your issue? #327 (comment) |
Looks very interesting! |
I’m seeing this error on navigation in IE11 sometimes even though I have no empty Styled JSX elements. It leads to a white screen of death — perhaps this shouldn’t be thrown, or should be thrown asynchronously so as not to prevent render altogether? |
As I said to @williamkunz
Ideas to improve this are welcome. |
Maybe what I’m seeing is a different issue that has the same end result — it’s (a) only in prod and (b) only in IE11, and (c) erratic. |
@bathos you may want to enable |
Thanks for the guidance, I’ll try that (I misunderstood earlier, thinking that you meant the rule had to be one which was seen as junk by Styled JSX, rather at runtime by the browser). |
@giuseppeg Is this still an issue? If so, in order to fix the issue would I just need to make it ignore all empty elements (in production/optimizeForSpeed)? Thanks |
@pudility to be honest I wouldn't fix this since empty rules is just one of the many reasons why this could fail. When in dev mode with The action item could be to always set This would be a breaking change though so we should reconsider when we will do the next major release. |
Gonna lock this conversation. If anybody is experiencing similar issues, my advice is to set Generally with If you don't have a lot of dynamic styles (e.g. you don't use In Next.js you can configure {
"presets": [
[
"next/babel",
{
"styled-jsx": { "optimizeForSpeed": true }
}
]
]
} For regular styled-jsx users please read the README.md. @pudility if you want to help out maybe we can start a FAQ section in the README.md and add the info from this comment. |
I believe we found a regression in 2.0 which only shows up in production.
It seems to be some kind of cleanup done by styled-jsx 2.0. Where empty
<style jsx>{``}</style>
-tags are used sometimes but removed when navigating away which causes this error:I've added a commit to my sample repo which shows the issue when you navigate back and forth between the "pages".
The text was updated successfully, but these errors were encountered: