-
Notifications
You must be signed in to change notification settings - Fork 13
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
CSS and JS changes not registering #36
Comments
It appears as though vagrant_webroot.conf under puppet/manifests already includes the line |
Hmm, that's strange @jackbeckwith. Firstly, what OS (platform / version) are you on? And secondly, what happens if, instead of using |
I'm on MacOS Sierra, 10.12.6. No, running |
Sorry to prod... but still having trouble. Any help here would be much appreciated 👍 |
Hmm, the next thing I would try is to make sure you're on the latest stable version of both Vagrant and VirtualBox. In the past we've had some issues that have come from people being on older versions of VirtualBox, which were fixed by upgrading from 5.0 to 5.1 |
Got it - I'm on VirtualBox 5.1.26. I'm not using rsync though... I think that might help? Would I need to modify this line in the Or is this handled by default if I install rsync? |
@nickautomatic I'm getting the same issue - making CSS changes and nothing is updating on the site (but html changes show up). Adding the EnableSendfile Off line didnt help. I am not using gulp or gulp watch, but previously css changes WERE getting updated even without using them. I'm thinking maybe some weird config got out of sync. A couple questions: Thanks! |
Just narrowed it down even more, When i make a change to a file on my local machine, the new file does show up on the Vagrant machine (accessed via Vagrant ssh) at /vagrant/app/public/css/somefile.css, but the website doesnt change and looks to be loading an older file. So I guess my main question is - where is the websites css file being loaded from? |
also, to be clear, I'm accessing the site by going to craft.dev, not localhost:3000 |
Alright so I think I've figured out the issue and a (hacky) way around it. First, my previous suggestion that That led me to believe it had something to do with the interaction between the VM and my browser. I think the browser is using a cached version of the files in
If I understand correctly, this tells Apache to retrieve a new version of any document directly from the source after 1 second has elapsed, instead of using a cached version. I added those lines, and ran |
Interesting - I'm not sure why your browser would be using a cached version (out of interest, which browser / version are you using? Let me know and I'll see if I can replicate this), but glad you've got it working. I'm surprised that you'd be experiencing this problem even when running @ccbeyer To be honest, using Crafty Vagrant without |
@nickautomatic I tried with gulp watch as well and still didnt update the files. It looks like browsersync detects the changes, but still nothing updates on the browser. I am using regular css, not scss, but i updated the gulpfile to reflect that (it seems correct at least, since its detecting the css changes). I ask where the files are loaded from because when i login to the vagrant machine, i can see the files and see that they are changing, and yet the website is loading the old files (i can inspect the files and they dont match those on the vagrant machine). |
Ah, ok. I'm wondering if you're directly editing the CSS files that are in the Either way, if you've changed the Gulpfile and it's not working, and you're not using Sass then I'm afraid there's not much we can do to help. I'm keen to fix issues that occur with a fresh install of Crafty Vagrant, but once people have started modifying Gulp tasks / server configuration then I'm afraid it becomes impossible to support. To be blunt, it becomes an issue you may have introduced rather than a problem with Crafty itself. However, since CSS is a subset of Sass, you should be able to use plain CSS without any modification to the default Gulpfile: you just need to write it in |
Hey @nickautomatic, quick question thats probably obvious for you. Say we clone crafty-vagrant and want to get started writing files from a fresh install. Would I put a javascript file in /app/src/scripts as, say scrolling-nav.js, and then not have to change anything in the gulp file to get this to work? Then, if I want to include this file in a craft template, say in /app/craft/templates/_layout.twig, do i just add to _layout.twig |
Also, similar question for css, in an effort to not have all css in one file, main.scss, can we have other .scss files in the same directory as main.scss and not change the gulp file, or if so, what changes would that require? |
Has anybody had trouble getting changes to their CSS and Javascript files to show up on craft.dev? Even when I run
gulp watch
, my edits seem to show up sporadically, if at all. However, changes to my HTML show up right away.A quick Google search gave me back this:
https://www.irwansetiawan.com/2014/07/static-files-in-vagrant-are-not-updating/
And from the Vagrant website:
https://www.vagrantup.com/docs/synced-folders/virtualbox.html
Has anybody dealt with this issue?
The text was updated successfully, but these errors were encountered: