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

[workaround] Updates to Tailwind css don't refresh when running dev server #3792

Closed
edapm opened this issue Nov 30, 2021 · 9 comments
Closed
Assignees
Labels
bug/confirmed We have confirmed this is a bug

Comments

@edapm
Copy link

edapm commented Nov 30, 2021

I have just started a new Redwood project and have added Tailwind. When writing pages, the updates to Tailwind classes do not show when running the dev server. I have to restart the dev server every time I make a change. Not sure if this is a Tailwind problem or a Redwood one.

I am running the project in Gitpod; I experienced the problem in v0.38 and after I upgraded to v0.39.

@thedavidprice thedavidprice moved this to New issues in Triage Nov 30, 2021
@jtoar jtoar added bug/confirmed We have confirmed this is a bug v1/priority and removed triage/processing labels Nov 30, 2021
@jtoar
Copy link
Contributor

jtoar commented Nov 30, 2021

Hey @edapm thanks for reporting this! @clairefro and I have confirmed this. It's a huge blow to DX.

Do you happen to know if it was working ok in v0.37 and that it broke when you upgraded to v0.38?

@edapm
Copy link
Author

edapm commented Nov 30, 2021

I created the project with v0.38 so not sure.

@mojombo
Copy link
Contributor

mojombo commented Nov 30, 2021

I know that @burnsy has this working with GitPod, perhaps he can share his insights.

@jtoar jtoar assigned jtoar and unassigned thedavidprice Dec 1, 2021
@jtoar
Copy link
Contributor

jtoar commented Dec 1, 2021

@edapm I believe I've found a temporary workaround for this. I've confirmed it locally but if you could confirm it as well that'd be great / give me more confidence.

In your .env file can you put:

TAILWIND_MODE=watch

@thedavidprice thedavidprice changed the title Updates to Tailwind don't show when running dev server [workaround] Updates to Tailwind don't refresh when running dev server Dec 1, 2021
@thedavidprice thedavidprice changed the title [workaround] Updates to Tailwind don't refresh when running dev server [workaround] Updates to Tailwind css don't refresh when running dev server Dec 1, 2021
@edapm
Copy link
Author

edapm commented Dec 2, 2021

@jtoar That works for me!

@aggmoulik
Copy link
Contributor

Hey @edapm thanks for reporting this! @clairefro and I have confirmed this. It's a huge blow to DX.

Do you happen to know if it was working ok in v0.37 and that it broke when you upgraded to v0.38?

@jtoar I have set up my project on v0.37 and it was working very well for me. So, I suppose it must be a change in v0.38

@jtoar jtoar moved this from New issues to Todo in Triage Dec 9, 2021
@zackdotcomputer
Copy link
Contributor

Just ran into this as well and also fixed it with TAILWIND_MODE=watch.

Worth noting as an avenue for debugging that the TW docs on that env flag say that it is a workaround for a failure in the usual flow. Usually the rebuild should be triggered by:

As of Tailwind CSS v2.2+, the JIT engine depends on PostCSS’s directory dependency messages to register your content files as CSS build dependencies with your build tool.

I confirmed that if I downgrade to Tailwind 2.2 and disable JIT, then the correct refresh behavior returns. So it does appear to be an issue with the pipeline from JIT to the build tool via the directory dependency system.

@jtoar jtoar added this to Release Dec 15, 2021
@jtoar jtoar moved this to Todo in Release Dec 15, 2021
@jtoar jtoar moved this from Todo to In progress in Triage Dec 16, 2021
@jtoar
Copy link
Contributor

jtoar commented Jan 3, 2022

Based on some of the recent comments in this thread, I've tested hot reloading again and it seems to work like before, without the need for the workaround. If someone who was using the workaround before could confirm that would give me more confidence!

@zackdotcomputer
Copy link
Contributor

zackdotcomputer commented Jan 4, 2022

@jtoar Just tested locally on the latest rw (0.41.0) and tailwind (3.0.9) and can confirm that autorefresh appears to be functioning normally once again when using yarn rw dev

I think this issue can be closed.

@jtoar jtoar closed this as completed Jan 6, 2022
Repository owner moved this from In progress to Done in Triage Jan 6, 2022
Repository owner moved this from Todo to Done in Release Jan 6, 2022
@jtoar jtoar removed this from Release Jan 25, 2022
@jtoar jtoar removed this from Triage Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug
Projects
None yet
Development

No branches or pull requests

6 participants