BrowserSync constantly get using Express / Gulp

I start the Express server and use browserSync to view the changes. When I run npm start , it starts the gulp task, which is executed:

 // Server task gulp.task('server', function(cb) { // We use this `called` variable to make sure // the callback is only executed once var called = false; return nodemon({ script: 'server.js', watch: ['server.js', 'app/**/*.js', 'config/**/*.js'] }) .on('start', function onStart() { if (!called) { cb(); } called = true; }) .on('restart', function onRestart() { // Also reload the browsers after a slight delay setTimeout(function reload() { browserSync.reload({ stream: false }); }, 500); }); }); // BrowserSync gulp.task('browser-sync', ['server'], function() { browserSync.init({ // All of the following files will be watched files: ['public/**/*.*'], // Tells BrowserSync on where the express app is running proxy: 'http://localhost:3000', port: 4000, open: false, notify: false, logPrefix: project.name, logConnections: false, logLevel: 'silent' }); }); 

However, in the terminal window, it continues to display the following:

 GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521010-28291 200 10.482 ms - - GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521032-28292 200 10.573 ms - - GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521053-28293 200 8.754 ms - - GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521082-28294 200 7.013 ms - - GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521110-28295 200 8.339 ms - - GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521134-28296 200 12.367 ms 

What causes this? How can i fix this?

+6
source share
1 answer

I ran into the same problem. Exiting powershell and restarting firefox fixed the problem.

Hope this helps!

+1
source

Source: https://habr.com/ru/post/984670/


All Articles