gulp-concat is not transforming my jsx files to js with reactify

258 Views Asked by At

I'm new to Gulp and I'm trying to transform my jsx files to js files using browserify and reactify but I'm getting and error. My gulp file looks like this:

var gulp = require('gulp'),
    nodemon = require('gulp-nodemon'),
    browserify = require('browserify'),
    reactify = require('reactify'),
    concat = require('gulp-concat'),

gulp.task('bundler', function() {
    gulp.src('public/javascript/app.jsx')
        .pipe(browserify({
            transform: 'reactify',
            extensions: ['.jsx']
        }))
        .pipe(concat('main.js'))
        .pipe(gulp.dest('./dist/javascript'));
});

gulp.task('server', function() {
    nodemon({
        script: 'server.js',
        ext: 'html js',
        watch: 'public'})
        .on('restart', function() {
            console.log('Restarted');
        });
});

gulp.task('default', ['bundler', 'server']);

But I'm getting this error:

TypeError: gulp.src(...).pipe(...).pipe is not a function
    at Gulp.<anonymous> (/Users/H/WebstormProjects/royalp/gulpfile.js:16:10)
    at module.exports (/Users/H/WebstormProjects/royalp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/H/WebstormProjects/royalp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/H/WebstormProjects/royalp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/H/WebstormProjects/royalp/node_modules/orchestrator/index.js:134:8)
    at /usr/local/lib/node_modules/gulp-cli/index.js:133:20
    at nextTickCallbackWith0Args (node.js:433:9)
    at process._tickCallback (node.js:362:13)
    at Function.Module.runMain (module.js:433:11)
    at startup (node.js:141:18)
/Users/H/WebstormProjects/royalp/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:523
    dest.end();
         ^

TypeError: dest.end is not a function
    at DestroyableTransform.onend (/Users/H/WebstormProjects/royalp/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:523:10)
    at DestroyableTransform.g (events.js:261:16)
    at emitNone (events.js:73:20)
    at DestroyableTransform.emit (events.js:167:7)
    at /Users/H/WebstormProjects/royalp/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:965:16
    at nextTickCallbackWith0Args (node.js:433:9)
    at process._tickCallback (node.js:362:13)

It was working fine before but all of a sudden it stopped working. I've been trying to fix it for hours now but I cant find the reason why it's not working, I would really appreciate some help.

0

There are 0 best solutions below