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
StyleSheet: insertRule
accepts only strings.
#298
Comments
Good catch, I suppose that you get this error because you are using external styles right? |
Yep, it was when we're using external styles. Wow what a quick fix, thank you! |
I will update Next.js asap |
@slaskis you can get this patch with |
@giuseppeg It looks like these Edit: Never mind, just noticed the doc update! Added the |
@jabacchetta, it would be a whole lot cooler if you can give an snippet of your code, before and after solving this issue. Thanks! |
@oleole90 I was just leaving out the
import css from 'styled-jsx/css'
export default css`div { color: green; }` |
My use case is to have dynamic styles with properties from theme that is being injected via HOC.
I get error during build:
I get a runtime error:
|
|
I forgot to mention that following snippet does work as expected:
|
I'm trying out the later next.js betas and now our tests will fail with this error:
After some debugging I realize it's because on this line
typeof rule == "string"
does not actually apply tonew String()
(which is"object"
), if I addif (rule instanceof String) {rule = rule.toString()}
on the line before the check it all seems to work perfectly.But I'm not sure if that's the proper solution or just a hacky work around which will fail somewhere else...
The text was updated successfully, but these errors were encountered: