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

server.origin breaks HMR (tailwind JIT) #5408

Closed
7 tasks done
leevigraham opened this issue Oct 25, 2021 · 12 comments · Fixed by #5571
Closed
7 tasks done

server.origin breaks HMR (tailwind JIT) #5408

leevigraham opened this issue Oct 25, 2021 · 12 comments · Fixed by #5571

Comments

@leevigraham
Copy link

leevigraham commented Oct 25, 2021

Describe the bug

Setting the server.origin property in vite.config.ts breaks tailwind JIT hmr.

Fixing the vite version to 2.5.10 fixes the issue (server.origin didn't exist so that makes sense).

Reproduction steps in the repro README: https://github.com/leevigraham/vite-hmr-issue-repro/blob/main/README.md

Reproduction

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

This is the simplest repro I could make. It uses the built in vite dev server.

System Info

System:
    OS: macOS 11.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Memory: 85.16 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.22.4 - /usr/local/bin/node
    npm: 6.14.14 - /usr/local/bin/npm
  Browsers:
    Chrome: 95.0.4638.54
    Edge: 90.0.818.56
    Firefox: 88.0
    Firefox Developer Edition: 94.0
    Safari: 15.0
    Safari Technology Preview: 15.4
  npmPackages:
    vite: ^2.6.4 => 2.6.10 

Used Package Manager

npm

Logs

No response

Validations

@engram-design
Copy link

Also seeing the same thing on 2.6.x, rolling back to 2.5.10 fixes this issue.

@y1d7ng
Copy link
Contributor

y1d7ng commented Oct 25, 2021

Task: Update the tailwind body class in templates/index.twig

Can't find the file templates/index.twig

@leevigraham
Copy link
Author

leevigraham commented Oct 25, 2021

@OneNail my mistake… I've updated the readme. In both cases the file that should be edited is src/index.html

@khalwat
Copy link
Contributor

khalwat commented Oct 26, 2021

Am seeing this issue as well

@innocenzi
Copy link
Contributor

innocenzi commented Oct 26, 2021

FWIW, here's an issue from someone else who got this issue with Laravel Vite (https://github.com/innocenzi/laravel-vite/issues/146).

I'm not sure how origin.server could be related to that problem though - it sounds like there is an underlying HMR issue, and that Tailwind JIT breaking is a side effect of that?

@github-actions
Copy link

Hello @leevigraham. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@y1d7ng
Copy link
Contributor

y1d7ng commented Oct 27, 2021

@OneNail There's a reproduction repo in the original ticket: https://github.com/leevigraham/vite-hmr-issue-repro with updated readme.

I switched the node version to 12.x and this problem was reproduced, I removed the need reproduction label.

@leevigraham
Copy link
Author

leevigraham commented Oct 27, 2021

I switched the node version to 12.x

@OneNail Oh I didn't even think about an older version of node being a possible issue. Could you reproduce the issue with node 14 / 16?

@y1d7ng
Copy link
Contributor

y1d7ng commented Oct 27, 2021

I switched the node version to 12.x

@OneNail Oh I didn't even think about an older version of node being a possible issue. Could you reproduce the issue with node 14 / 16?

I tried the 14.x version, it works fine.

@leevigraham
Copy link
Author

@khalwat @engram-design Can you confirm the issue is fixed on Node 14 / 16… It doesn't seem to be for me here.

@Esirei
Copy link

Esirei commented Oct 27, 2021

@khalwat @engram-design Can you confirm the issue is fixed on Node 14 / 16… It doesn't seem to be for me here.

I use Node 14 on Windows, so I know it's not fixed there. I will update to Node 16 and test it out.

@Esirei
Copy link

Esirei commented Oct 27, 2021

The issue still exist on Node 16.

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

Successfully merging a pull request may close this issue.

8 participants