sindresorhus / gulp-zip

ZIP compress files
MIT License
270 stars 47 forks source link

readable-stream throws error when using gulp-zip #105

Closed phun-ky closed 6 years ago

phun-ky commented 6 years ago

I have this code:

var zipDist = () =>
  gulp
    .src('dist/fonts/*')
    .pipe(zip('archive.zip'))
    .pipe(gulp.dest('./'));

Versions:

$ gulp -v
[16:02:03] CLI version 2.0.1
[16:02:03] Local version 4.0.0

package.json:

"gulp-zip": "^4.1.0",

I am getting this error:

[15:58:41] TypeError: Cannot read property 'on' of undefined
    at DestroyableTransform.Readable.pipe (_stream_readable.js:582:8)
    at zipDist (/project/packages/core/gulpfile.js:181:6)
    at taskWrapper (/project/packages/core/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (domain.js:301:14)
    at runBound (domain.js:314:12)
    at asyncRunner (/project/packages/core/node_modules/async-done/index.js:55:18)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

What could be the issue here? It seems that there is no stream sent to readable-stream

Using gulp-debug tells me that src(...) is finding files and passing to gulp-zip

phun-ky commented 6 years ago

Closing this. This was a PEBCAK.. zip was declared two times..