Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js: Styles disappear during HMR #608

Open
Peeja opened this issue Mar 26, 2025 · 0 comments
Open

Next.js: Styles disappear during HMR #608

Peeja opened this issue Mar 26, 2025 · 0 comments

Comments

@Peeja
Copy link

Peeja commented Mar 26, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant