Next.js Discord

Discord Forum

NextJS compiles styles in script tag in production

Answered
Oleg posted this in #help-forum
Open in Discord
Cant resolve problem with production build. Styles from layout appears as script and doesnt applies at all.
On dev mode from localhost all work fine!

First image - from localhost
Second - from production build
Answered by Oleg
Fixed by set “revalidate” variables in all layouts and pages.

But it’s confusing 🫤
View full answer

2 Replies

NextJs version - 14.0.4. I style with scss modules. Tried to downgrade to 13.5 but bug still there
Fixed by set “revalidate” variables in all layouts and pages.

But it’s confusing 🫤
Answer