Skip to content

[v4.1.3] Saved changes not reflected between hot-reloads / refreshes #17612

@andymerskin

Description

@andymerskin

I'm not sure if this is directly related to this PR, but after updating to Tailwind v4.1.3 which includes this change, I'm still not seeing changes reflected on each hot reload (but sometimes it works!), forcing me to restart my dev server for simple className changes in any context. For some reason Tailwind isn't picking up on new utilities being used. I haven't fully pinned down the cases where it's happening, but it's difficult to reproduce reliably.

Most recently, I changed the ordering inside a clsx + tailwind-merge call (cn), to change a string className, and move a className prop value at the end:

// before
<div className={cn("bg-white", className, getMyClassnames(props))} />

// after
<div className={cn("bg-black", getMyClassnames(props), className)} />

No hot reload and no update after a hard refresh, but after restarting the dev server, my change looked correct. Note that getMyClassnames(...) is returning a string of Tailwind classes.

Project details:

  • React 17 SPA on Vite 4 6 and Turborepo, with SWC plugin
  • We previously used Twin.Macro w/ Tailwind v3 and migrated it over to Tailwind v4

Environment:

  • turbo 2.0.4
  • vite 4.5.6 6.2.5
    • @vitejs/plugin-react-swc 3.8.1
    • @swc/plugin-styled-components 7.1.0
  • react 17.x
  • tailwind 4.1.3
  • typescript 4.9.3

Overall things are working fine. If upgrading Vite or Turbo is necessary to squash some of this behavior, happy to do it, but it may be quite a lift for us depending on how smoothly that goes.

I don't currently have time to put together a repro repo, but if my schedule opens up I may give it a shot. I'm more curious if anyone else is experiencing this with the latest version.

Originally posted by @andymerskin in #17554 (comment)

Metadata

Metadata

Assignees

No one assigned

    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