-
-
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
Addon-docs broken with emotion11 #16716
Comments
describes this issue, and eventually concluded that it is caused by two versions of @emotion/styled being installed. Upgrading the @emotion/styled dependency in @storybook/theming (storybook/lib/theming/package.json) should fix the issue for people using emotion v11, but will likely break for users using emotion v10. |
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! |
I had this issue as well. Was stumped and then checked out const path = require('path');
module.exports = {
webpackFinal: async (config) => {
// the emotion aliases ensure that only one context is loaded, without it the `useTheme` hook breaks
// in storybook
config.resolve.alias = {
...(config.resolve.alias ?? {}),
'@emotion/react': path.resolve('../../node_modules/@emotion/react'),
'@emotion/styled': path.resolve('../../node_modules/@emotion/styled'),
'@emotion/core': path.resolve('../../node_modules/@emotion/react'),
'emotion-theming': path.resolve('../../node_modules/@emotion/react'),
};
return config;
},
} |
storybookjs/builder-vite#219 links to: which mentions the
Which resolves Emotion 11 problem for me (using MUI 5) without the manual webpack aliasing. |
FYI we're working on a fix for this, hopefully available in the next few days |
Olé!! 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
I am building components using Chakra UI, which uses Emotion. When I navigate to the docs tab, it's blank and breaks all stories after you go there. This means once I encounter the error, Storybook is done until you reload (and not a Docs page of course).
To Reproduce
Use this repo to run Storybook and reproduce
System
Additional context
Please let me know if I can provide more information.
The text was updated successfully, but these errors were encountered: