browser-sync

Gulp browser says Cannot get /

时光怂恿深爱的人放手 提交于 2019-12-25 01:36:12
问题 I am using gulp.The tasks are getting run creating required folders. But I get Cannot GET/ error when run in browser.I have attached the image of my project structure and also the output in Gulp File structure Problem(Cannot get/) My index.html contains the following: <!DOCTYPE html> <html class="no-js" lang="en"> <head> <title>Bootstrap 4 Layout</title> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel=

Laravel + BrowserSync infinite loads

北城余情 提交于 2019-12-24 08:27:20
问题 I want to setup browserSync with laravel. I have a virtual host on local machine http://site.localhost . According to the manual I put this into my gulpfile.js: mix.browserSync({ proxy: 'site.localhost' }) So when I run gulp watch I got http://localhost:3000 open with just infinite loading. So what did I do wrong? 来源: https://stackoverflow.com/questions/39801873/laravel-browsersync-infinite-loads

Browser Sync not reloading with gulp

被刻印的时光 ゝ 提交于 2019-12-23 16:37:36
问题 I am trying to gulp browser sync as follows var liveReload = require('browser-sync').create(); //reload when something changes once scss is converted to css gulp.task('trigger-reload', ['sass'], function(){ liveReload.reload(); }); //set watchers to reload gulp.task('watch', function(){ liveReload.init({ server: { baseDir:'./' } }); gulp.watch('src/**/*.js', ['trigger-reload']); //js change }); Now when I make changes to the js file I see the following on my terminal : [00:19:23] Starting

Gulp Browsersync and http-proxy-middleware in offline mode

本秂侑毒 提交于 2019-12-23 16:04:30
问题 Does Browsersync with http-proxy-middleware work offline if I am proxying to a localhost server? I have an angular app deployed at localhost:3000 making requests for an api-server deployed at localhost:8080 . The http requests to the api-server are proxied by Browsersync http-proxy-middleware . Everything works fine if I have internet connection but, if I go offline, I get the following error on gulp console: [HPM] Proxy error: ENOENT localhost:8080/data/pet And on browser console: Failed to

How to make requests to a local Rails app from a local AngularJS app running on a different port?

情到浓时终转凉″ 提交于 2019-12-23 05:13:16
问题 I'm developing a web application with an AngularJS frontend and a Rails backend. My goal is to keep the two entirely separate, since the Rails app will ultimately be relegated to a simple REST server, and the AngularJS frontend will be just one of a few different clients that use the backend. For that reason, I don't want to integrate the frontend into the Rails asset pipeline, or similar. The Rails app is running locally on port 3000. The frontend uses Gulp to compile static assets, and

Why does Gulp fail to automatically re-process my JS upon changes?

徘徊边缘 提交于 2019-12-22 05:03:15
问题 In my gulpfile.js , JS changes automatically trigger both BrowserSync reload and my JS processing task. But for some reason, although the reload does work, my JS task fails to correctly process JS changes and create new JS file in dist/ folder. I have to restart Gulp for that. Why? Gulpfile.js: var gulp = require('gulp'); var sass = require('gulp-sass'); var browserSync = require('browser-sync').create(); var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var uglify =

browser-sync is blocked by chrome csp

你说的曾经没有我的故事 提交于 2019-12-21 20:46:03
问题 I have a gulp task that runs browsersync. var options = { proxy : 'localhost:9000/html' , port : 3000 , files : [ config.root + config.srcPaths.htmlBundle , config.htmlRoot + 'main.css' , '!' + config.htmlRoot + '**/*.scss' ] , injectChanges : false , logFileChanges : true , logPrefix : 'broserSync ->' , notify : true , reloadDelay : 1000 }; browserSync( options ); browsersync detects changes and tries to inject them but chrome blocks it with this error: Refused to connect to 'ws://localhost

gulp + browser-sync Cannot GET / error

岁酱吖の 提交于 2019-12-21 04:49:11
问题 I am learning the front-end build system currently gulp, i want to use brower-sync and the problem is it is not throwing an error in the commad line but instead when it brings up the browser it will not display my html file and it will say "Cannot GET /" error in the browser window. This is my gulpfile.js code var gulp = require('gulp'), uglify = require('gulp-uglify'), compass= require('gulp-compass'), plumber = require('gulp-plumber'), autoprefixer = require('gulp-autoprefixer'),

Browser-sync in mobile while local development

僤鯓⒐⒋嵵緔 提交于 2019-12-21 02:41:39
问题 How can I view my local dev website in my phone using gulp Browser-sync? I type localhost:3000 in my phones browser but it won't load 回答1: When you run gulp in your terminal you should see : [BS] Access URLs: -------------------------------------- Local: http://localhost:3000 External: http://192.168.10.81:3000 -------------------------------------- UI: http://localhost:3001 UI External: http://192.168.10.81:3001 What it means is that your local URL is localhost at port 3000. For external

Chrome can't open localhost:3000 with Gulp / BrowserSync

纵饮孤独 提交于 2019-12-19 09:09:47
问题 For some reason, no matter what I try, Google Chrome never seems to be able to display http://localhost:3000 (or any other specified port number for that matter) when starting up a server with BrowserSync through Gulp. Navigating to the same URI in Firefox, shows that it works and that BrowserSync is connected . gulp.task('browser-sync', function() { browserSync.init({ server: { baseDir: './' }, port: 8080 }); }); I'm specifying port 8080 above as an alternative , but even using the default