Hi all,
i’m fairly new to sage and I discovered gulp and browsersync only some days ago. I think I do a mistake but I cant get gulp watch and browsersync working together semalessly:
I run gulp watch → browsersync starts normally and I can browse the interface and open a new tab with my site
i modifiy _global.less located in assets/styles/common adding red color for h1
browsersync reload my site tab with the new title color
Here is my problem:
I redo point 2 changing just the color to orange, browsersync reloads, ‘injecting main.css’ pops-up but … the title retrurn to the original color: black
Where is my mistake ? Why is it working for the first round and not for the following ‘cycles’ ?
thanks for your help.
orange is spelled correctly in _global.less, but I realize that main.css injected in my browsersync tab doesn’t contain any modification I did in _global.less.
In fact my modifications in less files (_global.less) are not written in main.css when i’m using gulp watch and it’s apparently why browsersync inject main.css without any change.
When in doubt, delete node_modules and run npm install again. Make sure gulp compiles correctly. Make sure node and npm are at least the minimum versions required by Sage.
I had a similar problem, but I could never get my styles to change at all. My terminal tells me wiredep runs… And finishes… And then 2 files change (main.css, editor-style.css) and then it’s finished, but the changes never happen. I tried delete node_modules and run npm install again along with Gulp to compile and the problem continues.
i went and updated my npm and then ran " npm cache clear && rm -rf node_modules && npm install " ran gulp and then gulp watch I changed the body style to see if the styles would be injected. i got in the terminal
[BS] Access URLs:
[BS] Watching files…
[14:45:16] Starting ‘wiredep’…
[14:45:23] Finished ‘wiredep’ after 7.05 s
[14:45:23] Starting ‘styles’…
[BS] 2 files changed (main.css, editor-style.css)
[14:45:30] Finished ‘styles’ after 6.56 s
but no changes happened in my browser. I’m trying figure out where I went wrong? i am using Bedrock and VM, FYI. I don’t get any errors when installing npm or running gulp.
node -v && npm -v && gulp -v
v0.10.36
2.11.0
[15:00:28] CLI version 3.8.11
[15:00:28] Local version 3.9.0
I resolved the issue and it had nothing to do with a problem occurring in the sage theme or gulp file what so ever, it was my bad, so sorry for the waste of time anyone spent looking at this.
I’m having the same problem. I feel I had it working correctly and could make scss changes and they would compile to my dev main.css file but not anymore. How did you fix it?
For anyone who is experiencing this problem … make sure that you actually have Sage as your activated theme before running gulp watch … I believe this is what is happening to folks and perhaps no one wants to post up their “doh!” moment publicly … heh
Anyway, I have a solution that worked in my case, which may not be the same as other people’s issues…
It was basically a Firewall problem.
I am running my virtual servers in Windows VMware Workstation Pro.
The local VPS servers are all running Ubuntu 14.04 LTS with Nginx as the front end proxy.
I needed to open ports 3000 and 3001 in the VPS firewall.
Also, there is no real DNS in this setup, all the sites are mapped using my Windows Hosts file, and these in turn are mapped to the LAN IP address of the server in the Ubuntu hosts file.
Anyway, long story short, it was just that the server firewall was blocking ports 3000 & 3001