storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.68k stars 9.32k forks source link

[Bug]: v8 Loading @emotion/react more than once warning #27005

Open jlin5 opened 6 months ago

jlin5 commented 6 months ago

Describe the bug

On Storybook v8, I get a warning from @emotion/react:

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.

I found a bug that reported a similar issue https://github.com/storybookjs/storybook/issues/25761 but it still happens.

To Reproduce

  1. View https://stackblitz.com/edit/github-w7bhhe?file=src%2Fstories%2FButton.tsx
  2. Check the logs

System

Storybook Environment Info:

  System:
    OS: macOS 14.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v18.18.0/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
    pnpm: 8.12.0 - ~/.nvm/versions/node/v18.18.0/bin/pnpm <----- active
  Browsers:
    Chrome: 124.0.6367.92
    Safari: 17.4.1
  npmPackages:
    @storybook/addon-essentials: ^8.0.5 => 8.0.9 
    @storybook/addon-interactions: ^8.0.5 => 8.0.9 
    @storybook/addon-links: ^8.0.5 => 8.0.9 
    @storybook/addon-themes: ^8.0.5 => 8.0.9 
    @storybook/addon-viewport: ^8.0.8 => 8.0.9 
    @storybook/blocks: ^8.0.5 => 8.0.9 
    @storybook/react: ^8.0.5 => 8.0.9 
    @storybook/react-vite: ^8.0.5 => 8.0.9 
    @storybook/test: ^8.0.5 => 8.0.9 
    storybook: ^8.0.5 => 8.0.9

Additional context

No response

emiliegervais commented 6 months ago

Having the same problem on distant server (reproduction). It renders fine locally (no bug).

Capture d’écran 2024-05-16 à 17 35 12

shilman commented 6 months ago

Seeing this in the reproduction but not when I try to reproduce locally. 🤷