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

Wrapping MUI components with styled not working in pigment with vite after version 0.0.20 #352

Open
yishay-at-bay opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite

Comments

@yishay-at-bay
Copy link

yishay-at-bay commented Dec 19, 2024

Steps to reproduce

Steps:

  1. Create a new vite project with: yarn create vite vite-app --template react-ts (vite v5 or v6, yarn v1)
  2. install versions 0.0.28 of @pigment-css/react, pigment-css/vite-plugin and @mui/material v6
  3. define a StyledButton with:
    import { Button } from "@mui/material";
    import { styled } from "@pigment-css/react";
    
    const CustomButton: React.FC = () => {
      return <StyledButton>Click it</StyledButton>;
    };
    
    const StyledButton = styled(Button)(() => ({
      color: "green",
      backgroundColor: "orange",
    }));
    
    export default CustomButton;
    

Current behavior

When using @pigment-css/react and pigment-css/vite-plugin after version 0.0.20 I get the a lot of errors like:
Internal server error: node_modules/@mui/material/Tooltip/Tooltip.js Cannot read properties of undefined (reading 'vars')
Internal server error: /node_modules/@mui/material/Typography/Typography.js: Cannot read properties of undefined (reading 'typography')

Expected behavior

Latest versions (currently from 0.0.21 - 0.0.28) should work like version 0.0.20 or earlier

Context

No response

Your environment

No response

Search keywords: pigment vite version 0.0.20

@yishay-at-bay yishay-at-bay added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 19, 2024
@zannager zannager added the vite label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite
Projects
None yet
Development

No branches or pull requests

3 participants