Skip to content

Broken HMR with preact, automatic full page reload periodically, similar to #19903 #20411

Closed

Description

@DanhezCode

What version of Tailwind CSS are you using?

v4.3.3

What build tool (or framework if it abstracts the build tool) are you using?

preact@11.0.0-rc.0 or preact@10.29.8, vite@8.2.1 and tailwindcss@4.3.3, @tailwindcss/vite@4.3.3

What version of Node.js are you using?

bun@1.3.14

What browser are you using?

Edge

What operating system are you using?

Ubuntu

Reproduction URL

import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import preact from "@preact/preset-vite"

// The bug occurs with minimal configuration.
export default defineConfig({
  plugins: [
    tailwindcss(),
    preact() // The bug occurs with or without the preact plugin
  ],
  server: {
    // hmr: false // With this disabled, the problem doesn't occur, but I lose the hot module replacement.
  },
});

Describe your issue

The error is very similar to #19903, causing a full page reload and loss of all state periodically, even without any interaction. It's closely related to @tailwindcss/vite, and the behavior disappears if I disable hmr on the server. I also tried tailwindcss@insiders and @tailwindcss/vite@insiders and encountered the same problem.

Activity

  1. changed the title [-]hmr borken with preact, automatic full page reload periodically, similar #19903[/-] [+]hmr broken with preact, automatic full page reload periodically, similar #19903[/+] on Aug 13, 2026
  2. changed the title [-]hmr broken with preact, automatic full page reload periodically, similar #19903[/-] [+]Broken HMR with preact, automatic full page reload periodically, similar to #19903[/+] on Aug 13, 2026
  3. self-assigned this
    on Aug 13, 2026
  4. RobinMalfait commented on Aug 13, 2026

    @RobinMalfait
    Contributor

    Hmm, can you reliably reproduce it? Does it take x amount of changes, or some specific file you are changing?

  5. DanhezCode commented on Aug 13, 2026

    @DanhezCode
    Author

    Yes, the bug occurs from the very beginning with the minimum basic configuration. I've created a repository to reproduce it:

    https://github.com/DanhezCode/tailwindcss-issue-20411

  6. RobinMalfait commented on Aug 13, 2026

    @RobinMalfait
    Contributor

    This should be fixed by #20414, and will be available in the next release.

    You can already try it by using the insiders build:
    CLI:

    npm install tailwindcss@insiders @tailwindcss/cli@insiders

    PostCSS:

    npm install tailwindcss@insiders @tailwindcss/postcss@insiders

    Vite:

    npm install tailwindcss@insiders @tailwindcss/vite@insiders

    webpack:

    npm install tailwindcss@insiders @tailwindcss/webpack@insiders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions