-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storybook + Chakra UI V1 not displaying styles #13114
Comments
Do you have a repro repo you can share? |
Here you go, it's all standard install https://github.com/MariuzM/bug_testing |
Same problem here (https://github.com/ivan-dalmet/start-ui) |
Same problem in a project with NextJS + Typescript + Chakra UI + Storybook. |
Same problem |
I was able to work around this by implementing a custom |
Any updates on getting this fixed? |
@MariuzM PRs welcome! |
The fix should be to upgrade emotion to v11? Line 30 in a5bd17f
|
The theming from Chakra UI isn't working correctly due to some interaction between Storybook and Chakra UI both using Emotion: storybookjs/storybook#13114 chakra-ui/chakra-ui#2527
This issue is also happening with other libraries as well. |
Same here. |
Here is the solution that worked for me: module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
webpackFinal: async (config) => {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
"@emotion/core": "@emotion/react",
"emotion-theming": "@emotion/react",
},
},
};
},
}; |
This worked for me |
Maybe |
Slight modification, @Cretezy's solution did not work for me. I had to add const path = require('path');
module.exports = {
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
webpackFinal: async (config, { configType }) => {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
'@emotion/core': path.resolve(
__dirname,
'../node_modules/@emotion/react'
),
'emotion-theming': path.resolve(
__dirname,
'../node_modules/@emotion/react'
),
'@emotion/styled': path.resolve(
__dirname,
'../node_modules/@emotion/styled'
),
},
},
};
},
};
Make sure that |
After much debugging of the clash between versions of emotion used in storybook and in app, and for those who come after me, I found that storybook has now provided a feature flag to avoid clashing with later versions of emotion: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#emotion11-quasi-compatibility |
I think web is going to start moving to https://stitches.dev/ :D |
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! |
FYI, we'll hopefully have a proper fix out this week. |
Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.31 containing PR #17000 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Describe the bug
With the new version of Chakra UI v1 storybook has stoped displaying styles, when doing
yarn storybook
it loads the page but does not display the styles.Old version:
New version
Component
The text was updated successfully, but these errors were encountered: