Skip to content

vite server.origin breaks tailwind JIT HMR #5877

@leevigraham

Description

@leevigraham

What version of Tailwind CSS are you using?

2.2.17

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

vite 2.6.10

What version of Node.js are you using?

12

What browser are you using?

Firefox / Chrome / Safari

What operating system are you using?

macOS

Reproduction URL

https://github.com/leevigraham/vite-hmr-issue-repro

Describe your issue

Vite added a new server.origin property to it's config which: "Defines the origin of the generated asset URLs during development.". This is required for laravel or other backend rendered sites.

Setting the server.origin property breaks tailwind JIT HMR when editing templates. It looks like tailwind isn't even re-rendering the CSS. Editing the .pcss file works as expected.

Repro README has steps to reproduce the issue: https://github.com/leevigraham/vite-hmr-issue-repro/blob/main/README.md

My gut feeling is that this issue is more Vite than Tailwind.

Related vite issue: vitejs/vite#5408

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions