-
Notifications
You must be signed in to change notification settings - Fork 265
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
Upon Next v6 upgrade, global styles got broken #454
Comments
I have similar problem. vercel/next.js#4239 (comment) has explained the correct way to config babel. But it can not be solved when running with jest. check out this. vercel/next.js#4501 shows But I have no idea to address the problem. |
Yap, thanks for the reference, just tried now @blackbing still the same error, doesn't solve it for me either :/ |
it might be an issue with Babel 7, I think that a temporary workaround is to use CommonJS exports instead of ES6: module.exports = css`
div { color: red }
` |
Hi Everyone! I tried to figure out this issue. How said @giuseppeg there is problem with Babel 7 and after 2 days I got it. So I just create "crutch". Here is my _document.js
So I just added manually second <style dangerouslySetInnerHTML={{ __html: baseStyles.toString() }/> And after that everything work nice on next 6.0.3. |
Probably we are re using AST nodes which instead we should clone. |
this was fixed in #470 |
Do you want to request a feature or report a bug?
I want to report a Bug
What is the current behavior?
When upgrading to Next v6.0.3, my global styles have stopped working displaying the message: "styles is not defined", I'm currently using styled-jsx with styled-jsx-css-loader
If the current behavior is a bug, please provide the steps to reproduce and possibly a minimal demo or testcase in the form of a Next.js app, CodeSandbox URL or similar
Git repo with the use case in action, simple setup from scratch and it fails exactly the same:
https://github.com/voxmachina/nextjs-6-with-styled-jsx-demo
What is the expected behavior?
I would expect that the stylesheets would behave the same way as before and not break, note that only the "global" ones are failing, the others (scopped) are working ok as before.
Environment (include versions)
Did this work in previous versions?
Yes, it did work before the upgrade
The text was updated successfully, but these errors were encountered: