KEMBAR78
FOUC with css-modules while using "next/dynamic" · Issue #10557 · vercel/next.js · GitHub
Skip to content

FOUC with css-modules while using "next/dynamic" #10557

@khades

Description

@khades

FOUC with css-modules while using "next/dynamic"

Describe the bug

While using components with css-modules, if they are wrapped in "next/dynamic", they are unstyled until full hydration.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Get this demo - https://github.com/khades/next-dynamic-css
  2. Install its dependencies
  3. Build it.
  4. Run it. (Its more obvious in production mode).
  5. Set browser in "Slow 3G throttling mode".
  6. Open http://localhost:3000

Expected behavior

Either proper .css stylesheet comes in or whole page is not displayed unless all dynamic components are hydrated and styled.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions