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

Silent error while bundling with Watchify #323

Closed
Henauxg opened this issue Jul 13, 2016 · 1 comment
Closed

Silent error while bundling with Watchify #323

Henauxg opened this issue Jul 13, 2016 · 1 comment

Comments

@Henauxg
Copy link

Henauxg commented Jul 13, 2016

I use Browserify with watchify within gulp.

The (simplified) utilisation looks like this:

gulp.task("taskName", function() {
    var b = browserify({
        entries: ['./entryFile'],
        cache: {},
        packageCache: {},
    });
    b.plugin(watchify);

    b.on('update', bundle);
    bundle();

    function bundle() {
        b.bundle()
        .pipe(fs.createWriteStream('output.js'));
    }
})

The problem is that for any syntax error in the entries, the process (gulp taskName) will hang and not giving any info on the error.

I found a way to have the info by adding .on('error', function (e) {throw e;}) right after the .bundle(), but if I insert it anywhere else in the pipe chain of b.bundle. ... nothing happens.
I can also remove the watchify plugin and then the error is displayed.

Is it really what should happen?
And also if it is, shouldn't it be documented somewhere? Because when no feedback is returned, it's quite a bore to know what actually causes the process to block and who (watchify here I suppose) could potentially keep the error.

versions:
browserify@13.0.1
watchify@3.7.0

@zookatron
Copy link

I just spend 3 hours messing around with different error handlers before I found this.

This really needs to be fixed and/or better documented!

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