Page is briefly unstyled in NextJS production?

106 Views Asked by At

I'm working with NextJS and am currently looking at deployment. However, after running npm run build to see the production version of the website, I find that some pages are momentarily unstyled (text, image size). The images and text are fetched using getServerSideProps, where I make a request to my API. Why is this and how can I fix it?

I am importing my CSS modules as follows in the problematic pages:

import styles from "../../styles/Item.module.css";

Thanks in advance!

0

There are 0 best solutions below