I also noticed something strange when compiled with SSR. between pages you get a flash of unstyled content. when you are running the dev server this is not visible
I ran into this issue as well but from a different direction. I was working on page transitions using React Transition Group and the <SwitchTransition> component, with GSAP to create page transitions and had this problem of the styles. As you mention everything works great on development but in production the problems start.
The only solution I found so far is not use modules as the styling approach and have a single CSS file, which is not ideal.
I also noticed something strange when compiled with SSR. between pages you get a flash of unstyled content. when you are running the dev server this is not visible
I have not running into this issue so far. Do you mind share how you compiled your files?
looks like the stylesheets get unloaded right in between the transitions..
Having same issue !
Having the same issue. anyone have a solution?
I ran into this issue as well but from a different direction. I was working on page transitions using React Transition Group and the
<SwitchTransition>
component, with GSAP to create page transitions and had this problem of the styles. As you mention everything works great on development but in production the problems start.The only solution I found so far is not use modules as the styling approach and have a single CSS file, which is not ideal.
I made this repo:
github.com/rhernandog/next-gsap-tr...
Here is live:
cranky-heyrovsky-83f0a9.netlify.app/