Skip to content

Next.js: Styles disappear during HMR #608

Description

@Peeja

Steps to Reproduce

  1. pnpm create next-app --example with-goober with-goober-app
  2. cd with-goober-app
  3. pnpm run dev
  4. Open page. Notice h1 is black.
  5. Refresh. Notice h1 is orange.
  6. Change one of the strings in page.tsx. Notice h1 is black again.
  7. Refresh. Notice h1 is orange again.

Expected: The h1 should always be orange (tomato).
Actual: The h1 is black on first load after dev server startup and after HMR.

When the h1 is black, it's because all of the CSS is missing. You can even console.log({css}) and see { css: '' } when the CSS disappears, and { css: '.go…' } when it returns.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions