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

hash-files breaks tailwind hot reloading #271

Open
johnbchron opened this issue Apr 12, 2024 · 5 comments
Open

hash-files breaks tailwind hot reloading #271

johnbchron opened this issue Apr 12, 2024 · 5 comments

Comments

@johnbchron
Copy link

johnbchron commented Apr 12, 2024

Hey there! Thanks for adding the hash-files option; it's really helpful.

I have hash-files and tailwind enabled. When I change my code to add a new tailwind class, it kicks off the rust build and the tailwind build as expected, but when the page reloads I don't get the new styles. I suspect that this is because the hashes don't get properly updated for the CSS when tailwind rebuilds.

Right now I have to restart cargo leptos watch for the target/debug/hash.txt file to change, and also for the CSS link in the HTML head to change. Following the restart, I have the new classes.

I apologize that I don't have enough time for a reproduction right now, but to reproduce it should only require that hash-files and tailwind are enabled.

EDIT: actually I do have a reproduction, it's just not minimal :)

@johnbchron
Copy link
Author

Any thoughts on this? If there's not bandwidth to look at this, let me know and I can spend some time on it.

@gbj
Copy link
Contributor

gbj commented May 13, 2024

Generally with cargo-leptos the answer is going to be that there's not bandwidth to look at this, so definitely feel free to investigate.

@johnbchron
Copy link
Author

For others seeing this, my workaround is to turn hash-files off in the Cargo.toml and then add LEPTOS_HASH_FILES=true during the release build.

I'm still planning to investigate the root cause when I have some time.

@Boscop
Copy link

Boscop commented Sep 11, 2024

@johnbchron Any update on this? :)

@johnbchron
Copy link
Author

@Boscop Have not worked on this at all. cargo-leptos is basically just a ton of glue (not blaming anybody for this, it's just how side projects end up, when in this position) so I didn't have bandwidth to grok the codebase and diagnose the problem at the time I posted this.

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

No branches or pull requests

3 participants