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
389 stars 18 forks source link

NextJS 12 project fails with PigmentCSS #115

Open rkurbatov opened 3 weeks ago

rkurbatov commented 3 weeks ago

Steps to reproduce

Hi there. We have pretty old project with NextJS 12 and @emotion that has to be upgraded.

There are lots of dependencies, the whole circle of problems so I wanted initially to use the codemod and some manual changes to replace @emotion with Pigment CSS while staying on NextJS 12 (later versions don't support @emotion).

The problem is the application is failing now on the app.prepare() stage if I try to run it. Just a silent fail with status 0. No debugging messages, cannot catch anything. And the build process simply hangs running indefinitely.

The problem disappears when I remove withPigment() wrapper from nextjs config. That doesn't happen on NextJS 13 though there I have other non-related issues so I just want to make smal incremental updates.

I know that Pigment supports NextJS 12 but seems like there is something preventing it to work properly. Had somebody similar issues?

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: NextJS12

oliviertassinari commented 3 weeks ago

@rkurbatov Do you have a minimal bug reproduction that we can look into?