-
Notifications
You must be signed in to change notification settings - Fork 110
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
docs: document bug in safari that caches css and prevents hmr #258
Comments
Hi Kevin! Sounds like a bug in Safari, as the spec is very clear on that responses with I'll investigate during the week, but given that this library is using Rails See this post for a potential workaround. |
Sounds very reasonable. Is there any way a note can be added to documentation pointing out that this may not work correctly in Safari? It was a bit of a bear to work out what was flaking. It looks as though the js files don't send etags, so you can import your CSS in your JS files and that also works fine. |
Yeah, adding this to the Troubleshooting section, including the "import from JS" workaround would be nice. |
Closed by #261, thanks! |
bundle update vite_ruby
.Description 📖
In Safari on macOS (at least) when using
vite_stylesheet_tag
it is difficult to get new copies of a stylesheet as it changes. I believe this is because Safari isn't respecting theCache-Control: no-cache
when anETag
header is set. I am unsure if this is a bug in rails, vite-ruby or vite-rails. I was unable to work out where theETag
is set. I also tried in Chrome and there didn't seem to be an issue.Reproduction 🐞
Please provide a link to a repo that can reproduce the problem you ran into.
Vite Ruby Info
Run
bin/rake vite:info
and provide the output:Logs 📜
If not providing a reproduction:
Output
Run
DEBUG=vite-plugin-ruby:* bin/vite dev
orDEBUG=vite-plugin-ruby:* bin/vite build
and provide the output:Screenshots 📷
Provide console or browser screenshots of the problem.
On first load
![image](https://user-images.githubusercontent.com/1203658/190829149-798ea0b6-4b59-4d49-9f6d-f5c8e687a9a8.png)
On second load
On manually clearing caches and reloading again
![image](https://user-images.githubusercontent.com/1203658/190829244-8140ae1c-a1a5-400b-95e8-87b79805708f.png)
The text was updated successfully, but these errors were encountered: