mui / pigment-css

Pigment CSS is a zero-runtime CSS-in-JS library that extracts the colocated styles to their own CSS files at build time.
MIT License
799 stars 39 forks source link

Storybook Vite / AntD incompatibility #179

Open danLDev opened 3 months ago

danLDev commented 3 months ago

Steps to reproduce

repro

Current behavior

Storybook crashes with an obscure error

Expected behavior

Story should load as expected

Context

I'm not 100% sure if this is a pigment issue, but I'm seeing some very strange behaviour when combining pigment with antd in the same component.

Importing both of these in the same component file causes storybook to crash (we've also managed to recreate this in our vite app, but sb was easier to repro).

Interestingly, moving the classname to it's own file (exporting className from ./styles) works absolutely fine. Leading me to believe this is some sort of issue with the vite plugin and the way the files/modules are loaded, rather than config.

Your environment

npx @mui/envinfo ``` System: OS: macOS 14.2 Binaries: Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm pnpm: 8.15.6 - ~/.nvm/versions/node/v20.9.0/bin/pnpm Browsers: Chrome: 126.0.6478.127 Edge: Not Found Safari: 17.2 npmPackages: @emotion/react: 11.11.4 @emotion/styled: 11.11.5 @mui/private-theming: 6.0.0-dev.20240529-082515-213b5e33ab @mui/styled-engine: 6.0.0-dev.20240529-082515-213b5e33ab @mui/system: 6.0.0-dev.240424162023-9968b4889d @mui/types: 7.2.15 @mui/utils: 6.0.0-dev.20240529-082515-213b5e33ab @types/react: ^18.3.3 => 18.3.3 react: ^18.3.1 => 18.3.1 react-dom: ^18.3.1 => 18.3.1 typescript: ^5.2.2 => 5.5.3 ```

Search keywords: vite storybook antd ant-design

danLDev commented 3 months ago

@brijeshb42 Any idea when you're going to look at this?