-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Emotion CSS stringify errors after upgrading to 6.1.5 #13253
Comments
What version of emotion are you using? I received the same error using emotion(11), but I think this, not a bug with the storybook and yes with the emotion. |
{
"@emotion/cache": "^10.0.29",
"@emotion/core": "^10.0.35",
"@emotion/babel-preset-css-prop": "^10.0.9",
"babel-plugin-emotion": "^10.0.33",
"emotion": "^10.0.27",
} Strange that this would occur only after updating 6.0 to 6.1 though. |
Stranger, but I think this is a bug with emotion yet, you can share a repo case? |
Sadly, I can't share this code. After some playing around with another similar Storybook project:
I had both of these situations working locally, but not any deviation from these versions. |
Ok, maybe import the jsx pragma solve this problem! Or maybe, you can try:
|
You might be onto something with JSX pragma. I've tried a number of things to mess with configurations and found some more info. I have two projects both with Storybook and with different configurations. Both showed this error if I only used [
'@babel/preset-react',
{
importSource: '@emotion/react',
runtime: 'automatic',
},
], Although, using These look like issues unrelated to Storybook, but I'm not certain because I only saw these errors after upgrading Storybook. And it definitely seems fishy when certain versions of Emotion don't work with certain versions of Storybook. |
Recently I set up a storybook and everything works fine, check the babel maybe can help you. |
@mverissimo where have you used emotion's css props? |
Hi @VivekFitkariwala some other examples here |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Closing this issue as I've already resolved this issue. Certain versions of Storybook only work with certain versions of Emotion. It appears that the Emotion Babel props docs were updated recently to reflect the proper uses cases as well. |
Describe the bug
Seeing Emotion CSS stringify object errors on a
css
attribute after upgrading to6.1.3
or6.1.5
.This issue does not occur when using
6.1.0
,6.1.1
, or6.1.2
.To Reproduce
Steps to reproduce the behavior:
6.1.5
(tested both:6.1.3
, and6.1.5
).Expected behavior
I expect this to render CSS classes instead of text in a
class
attribute. Thecss
property should not be rendered as an HTML attribute and also does not contain text; it contains the an Emotion CSS class object.Screenshots
Code snippets
babel.config.js
Any React component with Emotion styling:
System
Docker container in the working state:
Additional context
I logged the Babel config and did see
'@emotion/babel-preset-css-prop',
at the bottom in all versions tested.The text was updated successfully, but these errors were encountered: