So, you’ve installed Eleventy (11ty), written your templates, hit that “npm start”, and… nothing happens? Or maybe the server works, but the browser doesn’t update when you change your files? Ugh. BrowserSync not working can be super annoying — we feel your pain.
TL;DR:
If 11ty’s BrowserSync isn’t refreshing or loading at all, it’s probably because of a config issue, missing dependency, or port conflict. This guide helps you explore all the common reasons and easy fixes. Most problems can be solved by checking your config file, your terminal output, and whether you’re in the right folder. Turn frustration into victory, one step at a time!
What is BrowserSync anyway?
BrowserSync is like a magical butler. It updates your browser the moment you change something in your files. It saves you from the ultimate pain of hitting refresh all day. 11ty uses it behind the scenes when you run a development server with npx eleventy --serve or a similar command.
Let’s Begin the Troubleshooting Adventure 🛠️
Let’s fix it together step by step. Here are the most common culprits with fixes you can try. You’ll be back to real-time updates in no time!
1. Are You Running the Right Command?
This might sound silly, but double-check.
- If you’re running
npx eleventy, that just builds your site. It doesn’t start a dev server! - Make sure you’re running
npx eleventy --serveor using a script likenpm startthat includes the--serveflag.
If you’re using a script in your package.json, it should look like this:
"scripts": {
"start": "eleventy --serve"
}
2. Check for Errors in the Terminal
If your terminal is screaming in red text — pay attention!
- Look for anything that includes “Error”, “ENOENT”, or “UNHANDLED”.
- BrowserSync depends on a successful build. If your build fails, the server never starts properly.
Go through the stack trace. Sometimes it’s just a missing comma or doing something weird in your config file.
3. Is Your BrowserSync Inject Enabled?
It should be — but some configs may have it off.
If you’re customizing your .eleventy.js, try adding or checking this part:
eleventyConfig.setBrowserSyncConfig({
files: './_site//*'
});
This makes sure BrowserSync knows where your compiled files are. If the ./_site folder isn’t listed, it won’t notice changes and won’t reload.
4. You Might Have a Caching Gremlin 👻
Browsers sometimes cache hard and refuse to let go.
- Try doing a hard refresh: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac).
- Also try opening your site in incognito.
If that makes it work, the issue might be with a cache-busting feature missing from your site.
5. Did You Install Everything?
BrowserSync is included with Eleventy, but only when installed properly.
Run this to make extra sure you have all dependencies:
npm install
If you’re using a new or cloned repo, this step is often skipped. Don’t be that guy. Or that lady. Or that sentient cat.
6. Port Conflicts Can Ruin the Party 🥳
If you already have another server or app using port 8080 (or whatever port BrowserSync wants), it won’t load.
- Look for warnings in the terminal about “EADDRINUSE” or “Port already in use”.
- Switch to an open port like so:
eleventyConfig.setBrowserSyncConfig({
port: 3000
});
You can try other ports too. Just don’t pick something that another app (like Docker) is obsessed with.
7. Something Wrong With Your Output Path
If your build output is going to the wrong folder, BrowserSync doesn’t know what to watch. By default, 11ty sends everything to the _site folder.
Double-check your .eleventy.js configuration:
module.exports = function(eleventyConfig) {
return {
dir: {
output: "_site"
}
};
};
If you changed the folder name, make sure that folder exists and isn’t git-ignored by mistake.
Image not found in postmeta8. Is Your Watch List Correct?
Sometimes you tell Eleventy to only look at a specific file type or folder, and it listens too well. Your files change, but it doesn’t notice.
Make sure you’re watching everything you need:
eleventyConfig.addWatchTarget("./src/");
That makes sure any change in the src/ folder triggers a rebuild, and thus a reload.
9. It Works, But Reload is Sluggish 😩
This might not be a *not working* issue, but a *slow working* one.
Here’s what you can do:
- Limit your build scope during development.
- Avoid giant image folders or video files being watched.
- Add
.eleventyignoreand ignore what you don’t need live.
Even half a second saved every file change adds up over hours of dev work! 🚀
10. Are You Opening the Right Localhost URL?
If you ran the server and something is serving… but your changes aren’t showing… you might just be looking in the wrong place.
In your terminal, look for something like this:
[Browsersync] Access URLs:
Local: http://localhost:8080
External: http://192.168.1.100:8080
Always open the “Local” URL in your browser. External might not refresh properly, especially on some networks.
11. Nuking the Project (aka “The Burn It All” Option)
When all else fails…
- Delete
node_modules - Delete
package-lock.json - Run
npm installagain
Sometimes weird dependency conflicts or corrupted installs just need a hard reset.
Wrapping Up 🎁
Don’t let BrowserSync bugs ruin your 11ty journey! Most problems come down to terminal warnings, misconfiguration, or simple overlooks like bad folder paths or missing dependencies.
Use this checklist. Bookmark it. Tattoo it on your forearm if necessary (Okay, don’t).
Quick Troubleshoot List:
- ✔️ Running
npx eleventy --serve? - ✔️ Terminal error-free?
- ✔️ Output going to
_siteor correct folder? - ✔️ Browser cached stuff cleared?
- ✔️ All files in
node_modulesinstalled? - ✔️ Watching the right files?
Now go forth and sync those browsers like a digital wizard!
11ty BrowserSync Not Working? Troubleshooting Guide
yehiweb
Related posts
New Articles
11ty BrowserSync Not Working? Troubleshooting Guide
So, you’ve installed Eleventy (11ty), written your templates, hit that “npm start”, and… nothing happens? Or maybe the server works,…