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 failure in 4.0 branch when merging streams with distinct destinations #1019

Closed
epong-yu opened this issue Apr 14, 2015 · 2 comments
Closed

Comments

@epong-yu
Copy link

Hi. In the 4.0 branch, I'm having trouble merging two streams that are distinctly piped to destinations. Consider this gulpfile:

var gulp = require('gulp');
var es = require('event-stream');

function test() {
  var stream1 = gulp.src('./file1')
        .pipe(gulp.dest('./dist/foo'));
  var stream2 = gulp.src('./file2')
        .pipe(gulp.dest('./dist/bar'));

  return es.merge(stream1, stream2);
}

gulp.task('default', test);

Running gulp gets me:

[14:31:15] Using gulpfile ~/src/gulp-test/gulpfile.js
[14:31:15] Starting 'default'...

And exits. The return code is 0, and nothing seems to show up with node-inspector. The files actually get copied:

dist
├── bar
│   └── file2
└── foo
    └── file1

But the task fails, and gulp quits; if I chain another task in series, it doesn't run. If I remove the destinations and pipe the merged stream to a common destination, the task succeeds.

I think better error management is being addressed elsewhere, so this issue is just about clarifying or addressing the behavior of these merged streams.

Not sure if I've fundamentally misunderstood how these streams behave, but this recipe expresses the behavior I'm trying to achieve.

@phated
Copy link
Member

phated commented Apr 14, 2015

EventStream is no longer supported because it is streams1, won't be updated and its merge method isn't a real stream. The open ticket for this is gulpjs/async-done#19

@phated phated closed this as completed Apr 14, 2015
@phated
Copy link
Member

phated commented Apr 14, 2015

We suggest switching to merge-stream for this use case.

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