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

Unhandled stream error in pipe #142

Closed
ralyodio opened this issue Oct 21, 2015 · 6 comments
Closed

Unhandled stream error in pipe #142

ralyodio opened this issue Oct 21, 2015 · 6 comments

Comments

@ralyodio
Copy link

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: write after end
    at writeAfterEnd (/Users/me/foo/node_modules/gulp-uglify/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:191:12)
    at DestroyableTransform.Writable.write (/Users/me/foo/node_modules/gulp-uglify/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:236:5)
    at Stream.ondata (stream.js:51:26)
    at Stream.emit (events.js:107:17)
    at Stream.endStream (/Users/me/foo/node_modules/gulp-usemin/node_modules/gulp-concat/index.js:90:10)
    at _end (/Users/me/foo/node_modules/gulp-usemin/node_modules/gulp-concat/node_modules/through/index.js:65:9)
    at Stream.stream.end (/Users/me/foo/node_modules/gulp-usemin/node_modules/gulp-concat/node_modules/through/index.js:74:5)
    at Transform.onend (/Users/me/foo/node_modules/gulp-usemin/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:523:10)
    at Transform.g (events.js:199:16)
    at Transform.emit (events.js:129:20)

Using node 12 and here is the gulpfile:

gulp.task('default', ['clean'], function() {
    return gulp.src('client/*.html')
        .pipe(usemin({
            css: [ rev() ],
            html: [ minifyHtml({ empty: true }) ],
            js: [ uglify(), rev() ],
            inlinejs: [ uglify() ],
            inlinecss: [ minifyCss(), 'concat' ]
        }))
        .pipe(gulp.dest('dist/'));
});
@terinjokes
Copy link
Owner

Please see this gulp recipe (linked from the README) which will help you handle your stream's errors.

@ralyodio
Copy link
Author

That yields the same error.

@terinjokes terinjokes reopened this Oct 21, 2015
@terinjokes
Copy link
Owner

Which usemine implementation are you using. What is "rev"?

@ralyodio
Copy link
Author

I'm using the first example on this README:

https://github.com/zont/gulp-usemin

Using node 0.12

@kxxoling
Copy link

Some error when trying gulp. My gulpfile.js is:

var gulp = require('gulp');
var rev = require('gulp-rev-append');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch')
var md5 = require("md5-file");
var replace = require('gulp-replace')

// Rerun the task when a file changes
gulp.task('scripts', function () {
  return gulp.src(['**/*.js'])
          .pipe(gulp.dest('dist'))
          .pipe(uglify())
          .pipe(gulp.dest('dist'));
});

It still exists although I removed all the unused requirements. So I think there is nothing wrong with them.

@kxxoling
Copy link

I found the error is I node_modules/ is also added under pattern **/*.js. It works after I changed this.

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

3 participants