wordpressgulpbrowser-syncgulp-browser-sync

Gulp Browser Sync Issue: http://192.168.1.104:8080/ Not Working


I am a beginner in WordPress. I am learning to build a WordPress theme using underscores. After typing "gulp" in the command line, http://192.168.1.104:8080/ is being opened in the browser. It continues to load, but ended up with this error:

This page isn’t working
192.168.1.104 didn’t send any data.
ERR_EMPTY_RESPONSE

Here is my gulp.js file:

var themename = 'kanonscores';

var gulp = require('gulp'),
    // Prepare and optimize code etc
    autoprefixer = require('autoprefixer'),
    browserSync = require('browser-sync').create(),
    image = require('gulp-image'),
    jshint = require('gulp-jshint'),
    postcss = require('gulp-postcss'),
    sass = require('gulp-sass'),
    sourcemaps = require('gulp-sourcemaps'),

    // Only work with new or updated files
    newer = require('gulp-newer'),

    // Name of working theme folder
    root = '../' + themename + '/',
    scss = root + 'sass/',
    js = root + 'js/',
    img = root + 'images/',
    languages = root + 'languages/';


// CSS via Sass and Autoprefixer
gulp.task('css', function() {
    return gulp.src(scss + '{style.scss,rtl.scss}')
    .pipe(sourcemaps.init())
    .pipe(sass({
        outputStyle: 'expanded', 
        indentType: 'tab',
        indentWidth: '1'
    }).on('error', sass.logError))
    .pipe(postcss([
        autoprefixer('last 2 versions', '> 1%')
    ]))
    .pipe(sourcemaps.write(scss + 'maps'))
    .pipe(gulp.dest(root));
});

// Optimize images through gulp-image
gulp.task('images', function() {
    return gulp.src(img + 'RAW/**/*.{jpg,JPG,png}')
    .pipe(newer(img))
    .pipe(image())
    .pipe(gulp.dest(img));
});

// JavaScript
gulp.task('javascript', function() {
    return gulp.src([js + '*.js'])
    .pipe(jshint())
    .pipe(jshint.reporter('default'))
    .pipe(gulp.dest(js));
});


// Watch everything
gulp.task('watch', function() {
    browserSync.init({ 
        open: 'external',
        proxy: 'kanonscores.com',
        port: 8080
    });
    gulp.watch([root + '**/*.css', root + '**/*.scss' ], ['css']);
    gulp.watch(js + '**/*.js', ['javascript']);
    gulp.watch(img + 'RAW/**/*.{jpg,JPG,png}', ['images']);
    gulp.watch(root + '**/*').on('change', browserSync.reload);
});


// Default task (runs at initiation: gulp --verbose)
gulp.task('default', ['watch']);

When I go inside "node_modules" of "gulp.dev" directory via NetBeans, I notice some errors in the folders of "browser-sync," "gulp" and "gulp-saas."

You can find the entire gulp.dev directory here: https://drive.google.com/open?id=1HaFcW0dCMIH3t8Dyg8f8hcQwxfux0GnT

Should I attach the entire exercise files, including the WordPress files?


Solution

  • My bad! I haven't launched WAMP. I am a poor beginner!