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

Expression produces a union type that is too complex to represent error when using css prop in JSX components #2418

Closed
1 of 3 tasks
kris-ellery opened this issue Mar 22, 2024 · 1 comment

Comments

@kris-ellery
Copy link

Description

After upgrading to Panda 0.36.0 I noticed a new TS error Expression produces a union type that is too complex to represent. when using css prop on JSX component.

Here is the simplest reproduction:

const MyComponent = (props: MyComponentProps) => {
  const { css: cssProp, ...rest } = props;
  return (
    <div
      className={css(cssProp)} // TS error
      {...rest}
    />
  );
};

More advanced reproduction: https://play.panda-css.com/u231oHYIOv (see line 39)

Link to Reproduction

https://play.panda-css.com/u231oHYIOv

Steps to reproduce

  1. Go to Panda Playground Reproduction
  2. Scroll to line 39
  3. See error

JS Framework

React (TS)

Panda CSS Version

0.36.0

Browser

Google Chrome 123

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@astahmer
Copy link
Collaborator

this happens because you're importing the (generic one) SystemStyleObject from @pandacss/dev instead of the (custom specific to your config) one from your local styled-system

https://play.panda-css.com/u231oHYIOv/CltXjOMa_n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants