Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin crashes gulp on syntax error #15

Open
alex-shamshurin opened this issue Mar 14, 2016 · 9 comments
Open

Plugin crashes gulp on syntax error #15

alex-shamshurin opened this issue Mar 14, 2016 · 9 comments

Comments

@alex-shamshurin
Copy link

The plugin feeds an invalid glob pattern to the output chain if some errors occur with jade syntax.
(to next gulp.src())

The end of the string was reached with no closing bracket found.resources/jade/frontend/modules/_banner.jade

/Users/Shared/www/beirut/node_modules/gulp-jade-inheritance/node_modules/vinyl-fs/lib/src/index.js:37
    throw new Error('Invalid glob argument: ' + glob);
    ^

Error: Invalid glob argument: 
    at Object.src (/Users/Shared/www/beirut/node_modules/gulp-jade-inheritance/node_modules/vinyl-fs/lib/src/index.js:37:11)
    at Stream.endStream (/Users/Shared/www/beirut/node_modules/gulp-jade-inheritance/index.js:63:11)
    at _end (/Users/Shared/www/beirut/node_modules/gulp-jade-inheritance/node_modules/through/index.js:65:9)
    at Stream.stream.end (/Users/Shared/www/beirut/node_modules/gulp-jade-inheritance/node_modules/through/index.js:74:5)
    at Transform.onend (/Users/Shared/www/beirut/node_modules/gulp-cached/node_modules/readable-stream/lib/_stream_readable.js:523:10)
    at Transform.g (events.js:273:16)
    at emitNone (events.js:85:20)
    at Transform.emit (events.js:179:7)
    at /Users/Shared/www/beirut/node_modules/gulp-cached/node_modules/readable-stream/lib/_stream_readable.js:965:16
    at nextTickCallbackWith0Args (node.js:453:9)

My task:

gulp.task('jade', function (cb) {
    return gulp.src(['**/*.jade'], {cwd: app + 'jade'})
        .pipe($.plumber(options.plumber))
        .pipe($.cached('jade'))
        .pipe($.if(global.isWatching, jadeInheritance({basedir: app + 'jade'})))
                .pipe($.filter(function (file) {
            return !/\/_/.test(file.path) && !/^_/.test(file.relative);
        }))
        .pipe($.jade(options.jade))
        .pipe($.prettify(options.htmlPrettify))
        .pipe($.rename(function (path) {
            path.extname = ".blade.php";
        }))
        .pipe(gulp.dest(app + 'views'))
        .pipe($.size({title: 'jade'}))
        .pipe(browserSync.reload({stream: true}));

});

I think it must not kill a gulp process.

@juanfran
Copy link
Owner

the gulpfile looks good, could you paste the content of _banner.jade?

@alex-shamshurin
Copy link
Author

It occurred during editing. I do not know what it was. But sometimes it
happens.

@alex-shamshurin
Copy link
Author

Error is in my issue description above

The end of the string was reached with no closing bracket 

So I think a plugin must handle it somehow.

@juanfran
Copy link
Owner

did you try this?

gulp.task('jade', function (cb) {
    return gulp.src(['**/*.jade'], {cwd: app + 'jade'})
        .pipe($.plumber(options.plumber))
        .pipe($.cached('jade'))
        .pipe($.if(global.isWatching, jadeInheritance({basedir: app + 'jade'})))
                .pipe($.filter(function (file) {
            return !/\/_/.test(file.path) && !/^_/.test(file.relative);
        }))
        .on('error', gutil.log)) //handle error
        .pipe($.jade(options.jade))
        .pipe($.prettify(options.htmlPrettify))
        .pipe($.rename(function (path) {
            path.extname = ".blade.php";
        }))
        .pipe(gulp.dest(app + 'views'))
        .pipe($.size({title: 'jade'}))
        .pipe(browserSync.reload({stream: true}));
});

@alex-shamshurin
Copy link
Author

Ok, I'll try

@alex-shamshurin
Copy link
Author

This one do not run even if remove redundant bracket.

@juanfran
Copy link
Owner

sorry for the delay in my answers

I think that I've fixed the problem, could you upgrade to gulp-jade-inheritance 0.5.5? thanks

@alex-shamshurin
Copy link
Author

I cannot upgrade because 0.5.5 right now is unavailable

@juanfran
Copy link
Owner

It should be available now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants