Skip to content
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

[Bug]: Loading @emotion/react more than once #25761

Closed
vanessayuenn opened this issue Jan 25, 2024 · 1 comment · Fixed by #25925
Closed

[Bug]: Loading @emotion/react more than once #25761

vanessayuenn opened this issue Jan 25, 2024 · 1 comment · Fixed by #25925

Comments

@vanessayuenn
Copy link
Contributor

Describe the bug

Project: MealDrop
Version: 8.0.0-alpha.4
Bug/feedback:

When loading any MDX (docs only or autodocs) in Storybook 8.0.0-alpha-4 or higher, there is a warning in the console mentioning that emotion is loaded multiple times:

You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.

Apart from emotion being instantiated by the Manager UI, there are two moments where it gets instantiated in the Preview UI:

Via @storybook/components
image

Via @storybook/addon-docs/node_modules/@storybook/components
image

To Reproduce

  1. Go to https://github.com/yannbf/mealdrop/tree/bug/multiple-instances-emotion
  2. Run Storybook
  3. Check the logs

System

No response

Additional context

No response

@JReinhold
Copy link
Contributor

I have a fix for this, but I think it's highly related to #25737 so I'm trying to fix both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants