[Browsersync] Couldn’t open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)
I have built several sites with Roots stack now and suddenly, BrowserSync is no longer working on one of them.
However, BrowserySync is working on all the others. So this suggests to me that there is a configuration I have changed in this particular site. However, I don’t believe I changed any configuration files – if for no other reason than I wouldn’t know which one to modify to impact BrowserSync in any way. So I’ve rechecked the
trellis/group_vars files, and
trellis/hosts and not found anything unusual. So I tried destroying the VirtualBox with
vagrant destroyto see if that reset anything, but I ended up with the same result.
So I’m back to looking for a specific configuration file for BrowserSync that contains the “open” argument in it as specified in the error. I previously modified this before I wrote this article and it didn’t change anything. So I am circling back to that now.
In the end, I found that editing
myTheme/node_modules/browser-sync/lib/default-config.js and changing the “open” value to “false” (but without quotes) silenced the error. However it does not open the browser now when I begin
gulp watch like it used to. Not a big deal though. But still a problem I want to fix.
In the context of website development or application development a wireframe black and white, deliberately simplified line drawing of the layout of a website or application. This is sometimes mistakenly synonymous with website prototyping. How are they used? Wireframing is one step in a professional website design process. It’s a time and cost efficient […]
We developer custom WordPress Themes from scratch and existing platforms like Roots (Trellis, Bedrock and Sage), as well as custom WordPress Plugins. We’ve done so for almost the entire time we’ve been in business (circa 2005). Over time we’ve gradually discovered the limitations with WordPress but ultimately decided that the alternatives were just that: an […]
I have a knack for hitting every possible obstacle. It stems from the early days of my education and is something I’ve had to hobble through life trying to mitigate. Since the internet though, I’ve found that there are many others like me. So when I try a new technology I am in the habit […]