S
S
Sergey Burduzha2017-04-08 21:01:05
gulp.js
Sergey Burduzha, 2017-04-08 21:01:05

TypeError: Cannot read property 'match' of undefined?

var gulp = require('gulp'); var browserSync = require('browser-sync').create(); var reload = browserSync.reload;
// Save a reference to the `reload` method
// Watch scss AND html files, doing different things with each.
gulp.task('default', function () {
// Serve files from the root of this project
browserSync.init({
proxy: {
baseDir: "./"
}
});
gulp.watch("./**/ *.*").on("change", reload);
});
and here is the error itself:
$ gulp
[20:56:57] Using gulpfile D:\WEB\OpenServer\domains\regexp\gulpfile.js
[20:56:57] Starting 'default'...
[20:56:57 ] 'default' errored after 5.72 ms
[20:56:57] TypeError: Cannot read property 'match' of undefined
at Object.proxy (D:\WEB\OpenServer\domains\regexp\node_modules\browser-sync\lib\cli\cli-options.js:123:20)
at D:\WEB\OpenServer\domains\regexp\node_modules\ browser-sync\lib\cli\cli-options.js:280:54
at D:\WEB\OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:3018:46
at D:\WEB\OpenServer\ domains\regexp\node_modules\immutable\dist\immutable.js:1379:16
at ValueNode.iterate (D:\WEB\OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:1746:12)
at BitmapIndexedNode. iterate.HashArrayMapNode.iterate [as iterate] (D:\WEB\OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:1739:24)
at HashArrayMapNode.BitmapIndexedNode.iterate.HashArrayMapNode.iterate [as iterate] (D:\WEB\OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:1739:24)
at Map.__iterate (D:\WEB\ OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:1377:32)
at KeyedIterable.mappedSequence.__iterateUncached (D:\WEB\OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:3017: 23)
at seqIterate (D:\WEB\OpenServer\domains\regexp\node_modules\immutable\dist\immutable.js:606:16)
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Burduzha, 2017-04-08
@serii81

Found the answer, you need to register proxy instead of server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question