Doesn't reload a browser
See original GitHub issueThe plugin doesn’t reload a browser.
In console it says [BS] Reloading Browsers...
but nothing is reloaded.
Neither it works with injected script tag, nor without.
Nodemon works like a charm but not browser-sync.
Here is my gulpfile.js:
var gulp = require('gulp'),
gutil = require('gulp-util'),
browserify = require('gulp-browserify'),
nodemon = require('gulp-nodemon')
compass = require('gulp-compass'),
gulpif = require('gulp-if'),
uglify = require('gulp-uglify'),
// minifyHTML = require('gulp-minify-html'),
concat = require('gulp-concat'),
browserSync = require('browser-sync'),
path = require('path');
var port,
env,
nodemonConf,
scssSources,
scssStyle,
jsSources,
templateSources,
outputDir;
port = 3000;
env = 'development';
nodemonConf = {
script: "index.js",
ext: 'js html dust json scss',
env: { 'NODE_ENV': env },
nodeArgs: ['--debug']
}
if (env==='development') {
scssStyle = 'expanded';
} else {
scssStyle = 'compressed';
}
// browserSync({
// port: 8000,
// baseDir: "./"
// });
gulp.task('browser-sync', function() {
browserSync({
open: false,
server: {
baseDir: "./"
}
});
});
gulp.task('dev', function() {
nodemon(nodemonConf)
.on('restart', function () {
browserSync.reload();
console.log('== Restarted! ==');
});
});
gulp.task('default', ["browser-sync", "dev"]);
I did as tutorial says. Why it doesn’t work?
Issue Analytics
- State:
- Created 9 years ago
- Comments:30 (1 by maintainers)
Top Results From Across the Web
5 Ways to Force Refresh in Your Internet Browser - wikiHow
You can simply hit the refresh button in the top left corner (assuming you are using Safari). It looks like a circle with...
Read more >Fix: My Browser's Refresh Button is Not Working - Technipages
Troubleshooting Your Browser's Refresh Button · 1. Perform a hard refresh · 2. Clear your browser history and cache · 3. Unplug your...
Read more >Simple steps to refresh your web browser cache
Simply, On windows Press Ctrl+F5 and On Mac press Option+⌘ Command+E to empty your cache, and then ⌘ Command+R to refresh the page....
Read more >How to Hard Refresh Your Web Browser (to Bypass Your ...
Chrome, Firefox, or Edge for Windows: Press Ctrl+F5 (If that doesn't work, try Shift+F5 or Ctrl+Shift+R). Chrome or Firefox for Mac: Press Shift ......
Read more >What is a Hard Refresh? How to do a Hard Refresh in Any ...
A hard refresh clears your browser cache for a specific page, which forces it to load the most recent version of that page....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I figured it out. I was responding with just 200 (serverside) and that means no body tag for browser-sync to inject the script tag. @rjaguilar maybe you have similar issue ?
check if your page has a body tag because browser-sync works only with files having body tag