CSS for federated components is not loading server side on module-federation/nextjs-mf v7 or v8
I demonstrated this using the examples repo. The below screenshots and video show "this is from checkout!" becomes red after load, resulting in a flash of unstyled content. This was demonstrated by forking the repo: https://github.com/K-Cheddar/module-federation-examples/tree/master/nextjs-ssr
Before JS loads:
After JS loads:
Video:
The chunks that should include the css on the server is an empty array:
This is all run with the dependencies as given in the examples repo:
"dependencies": {
"@module-federation/nextjs-mf": "^8.1.0-canary.1",
"lodash": "4.17.21",
"next": "^13.5.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"webpack": "5.89.0"
}
Also happens in 7.x and 8.1.0-canary.5
is this in production mode? dev mode doesnt flush css chunks as its style-loader
Yes, this is in production mode.
Okay. We are rewriting federation and will circle back to this after rewrite.
Thanks for letting me know. Do you have a rough eta for when you plan to release the rewrite?