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
Help with odd issue! #1
Comments
Interesting setup you got here, I've made all my images with remote setup in mind. When the BrowserSync container is running can you
|
Thanks for your response. Yes, I can see the contents of the bs.js file: module.exports={
ui: false,
open: false,
files: ["/var/www/html/assets/css/*.css"],
proxy: "http://www.site.test",
port: 3000,
rewriteRules:[{
match: /http:\/\/localhost/g,
fn: function (e,r,t) {
return "http://localhost"
}
}],
scriptPath: function (path) {
return "" + path;
},
socket: {
domain: "http://bs.site.test"
}
}; Actually, the issue may have nothing to do with demyx/browsersync. In the meantime, I've been looking around and found out that NFS doesn't seem to support inotify events, which may explain why everything works when I manually trigger a change from the linux box, but not when the change is triggered from the other end of the nfs share. I'll update this thread if I can find a way around the problem. Thanks! |
No problem, I will close this for now. |
Just in case somebody else is having this problem: Yes, the culprit here is NFS, which doesn't send fsevents to the client so the linux box simply isn't unable to react when a file is changed. I've spent most of the day trying different solutions and so far the easiest and more straightforward is notify-forwarder, which successfully triggers an ATTRIB event on the client side of the NFS share and makes BrowserSync happy again. You can even setup some sort of automation process in your IDE to make it automagically for you (I did with PhpStorm and a handy bash script). |
Hi. I've spent the last few hours pulling my hair trying to figure out what's going on with my setup and finally gave up, so I thought somebody here could give me a hand.
I'm using the following docker-compose.yml file:
This gives me two working containers, my web app at http://www.site.test and another with BrowserSync at http://bs.site.test. Everything seems OK with the BrowserSync container, I can see the proxy site and the "BrowserSync: connected" badge at the top of the page when I open it in the browser. But here's the thing: I can't make it reload files automatically when they're changed.
I use two computers for my development work: my workstation is an iMac where all the files are stored. A second computer (a Mac Mini) is running Ubuntu Server, which is where Docker is running. Since the actual code files live in the workstation, everything is mounted as a nfs share from the Ubuntu server. From there, Docker containers load volumes as local directories.
So, whenever I make a change in a file from the remote workstation, the change is propagated to the Ubuntu server, and picked up by the Docker volume. This usually works great and gives me no issues whatsoever. But for some reason, it won't trigger the event that makes BrowserSync to recognize that the file has changed.
Obviously, I first checked for errors in paths, etc. But any change from the workstation is being propagated just fine to the server, as usual. When logged in the Ubuntu server I can see how files are modified as soon as I make a change from the workstation.
Now, the funny thing is that if I manually change a file when logged in the server like this:
The change is detected perfectly by BrowserSync and http://bs.site.test is updated immediately. I can also make the change inside the BrowserSync container, and it also works flawlessly:
Hope you can give a hint. Thanks in advance!
The text was updated successfully, but these errors were encountered: