stylex icon indicating copy to clipboard operation
stylex copied to clipboard

CSS output inconsistency between builds

Open mrmntte opened this issue 2 years ago • 2 comments

The problem npm run build doesn't include all/some classes in the final css file. Usually only the first build (without .next/ cache) is generated correctly, but it's inconsistent. I'm not sure if this also makes it happen randomly with npm run dev when navigating between routes.

all classes are missing: image

some: image

How to reproduce run multiple times npm run build && npm run start https://stackblitz.com/edit/github-kh7iw4?file=app%2Flayout.tsx

Expected behavior image

mrmntte avatar Dec 21 '23 13:12 mrmntte

I also have to occasionally remove .next dir to refresh styles.

steida avatar Dec 21 '23 13:12 steida

This is a known issue which is why the NextJS example in the repo does this:

"clean": "rimraf .next",
"predev": "npm run clean",
"prebuild": "npm run clean",

I've already reached out to the NextJS team for help. In the meantime, I'll fix the Stackblitz example.

nmn avatar Dec 21 '23 20:12 nmn