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
396 stars 19 forks source link

unhandledRejection: EvalError: Cannot set properties of null #72

Open paulm17 opened 1 month ago

paulm17 commented 1 month ago

Steps to reproduce

Clone repo: https://github.com/paulm17/raikou_pigmentcss pnpm i pnpm run dev

The app will crash with a stack trace:

⨯ unhandledRejection: EvalError: Cannot set properties of null (setting 'displayName')

This only happens when the page is a client component.

Remove: https://github.com/paulm17/raikou_pigmentcss/blob/main/apps/web/app/page.tsx#L1

and re-run and the issue goes away.

Current behavior

When a page is marked as "use client". The result of the transform process on code is missing variables? I'm guessing at this point. Therefore it leads to a crash due to an undefined variable.

Expected behavior

Whether a page has "use client" or not. A component with compound properties should work fine.

Context

Using pigment-css with a component library.

Your environment

No response

Search keywords: Cannot set properties of null