Components that use next/dynamic to load and that have a CSS module lose thier CSS when navigating to another page that contains the same dynamically loaded component.
- Clone repo and run
npm install && npm run build && npm run start - Open a browser and go to http://localhost:3000
- Click the link to go to the "other page"
TestComponent should retain their styles.
TestComponent lose their styles.
This issue only occurs when navigating via page links, direct access to the index or other-page load the CSS correctly.
This bug appears to have been introduced as a regression from #12843 that fixed a related issue, #10557, where there is a flash of unstyled content when navigating to a page that contains a dynamically loaded component. I verifed that this new issue is not present in 9.5.3-canary.20, but is present on 9.5.3-canary.21 and is currently present in 9.5.3.