Prod and Dev rendering differently
Unanswered
Devon Rex posted this in #help-forum
Devon RexOP
For some reason one of the pages in my applications Taildwind CSS appears to not be applying when I do a Prod Build, but displays properly in Dev mode.
(The image with the padding is displayed correctly in when running
Issue only occurs on 1 page of the applications, in a server rendered portion.
Any ideas on the issue?
(The image with the padding is displayed correctly in when running
next dev)Issue only occurs on 1 page of the applications, in a server rendered portion.
Any ideas on the issue?
12 Replies
European sprat
Are you getting any errors in the console? Maybe something to do with hydration
@European sprat Are you getting any errors in the console? Maybe something to do with hydration
Devon RexOP
No console errors in client or server.
Only log that comes up in prod is a metadata warning.
Only log that comes up in prod is a metadata warning.
- warn
metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
Warning: For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'yarn add sharp', and Next.js will use it automatically for Image Optimization.
Read more: https://nextjs.org/docs/messages/sharp-missing-in-production@Devon Rex For some reason one of the pages in my applications Taildwind CSS appears to not be applying when I do a Prod Build, but displays properly in Dev mode.
(The image with the padding is displayed correctly in when running `next dev`)
Issue only occurs on 1 page of the applications, in a server rendered portion.
Any ideas on the issue?
tried deleting your browser's cache and refetching it?
@alfon tried deleting your browser's cache and refetching it?
Devon RexOP
Yup, tried clearing cache, and opening it in different browsers which hadn't opened this page before as well, and even used a different device to run/test it.
None of those had an effect
None of those had an effect
that sucks
have you tried updating next and tailwind?
@alfon have you tried updating next and tailwind?
Devon RexOP
Yeah, they're both on the latest versions
European sprat
Try ruling out tailwind by inlining the styles?
@European sprat Try ruling out tailwind by inlining the styles?
Devon RexOP
Good thought, so just implemented, and in line styles makes prod style correctly,
@Devon Rex Good thought, so just implemented, and in line styles makes prod style correctly,
European sprat
I don't have any suggestions for what to try to fix it but at least you've narrowed it down 🙂
must be something happening during the build
Devon RexOP
Thanks for the help