Skip to content

Disabling HMR Prevents Tailwind from Updating #10270

@digitalam025

Description

@digitalam025

Describe the bug

I disabled HMR because it causes every tab to reload, whereas what I need is that only 1 tab to be reloaded while others stay put for me to compare the style changes visually.

By setting server.hmr to false, it does what I want, to stop HMR. But on a manual refresh in the browser, the Tailwind styles don't get updated. As if the JIT engine doesn't get re-ran.

I've discussed this not in Vite's Discord but Laravel's. But I don't think this is such a specific issue.
Link to the post here: https://discord.com/channels/297040613688475649/1024554528734969857

In the reproduction link below:

  1. Replace text-red-500 with any other style, such as text-yellow-500 or text-2xl etc.
  2. Save the file (index.html) and manually hit reload.
  3. Notice that the style is not changed and reset to as if there were no styles present.

Reproduction

https://stackblitz.com/edit/vitejs-vite-wwtrrb?file=index.html&terminal=dev

System Info

System:
    OS: Linux 5.10 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (6) x64 AMD Ryzen 5 5600G with Radeon Graphics
    Memory: 1.41 GB / 3.84 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    npm: 8.7.0 - ~/.nvm/versions/node/v16.14.0/bin/npm
  npmPackages:
    @vitejs/plugin-vue2: ^1.1.2 => 1.1.2 
    vite: ^3.1.0 => 3.1.0

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: hmrp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions