Possibly unhandled Error: path should be string
BenjaminRH opened this issue · comments
I'm getting the following error:
Possibly unhandled Error: path should be string
at File.Object.defineProperty.set (/Users/benjaminrh/appem/node_modules/gulp/node_modules/vinyl-fs/node_modules/vinyl/index.js:166:41)
at Function.assign (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/lodash-node/modern/objects/assign.js:63:21)
at /Users/benjaminrh/appem/node_modules/gulp-cache/lib/TaskProxy.js:20:19
at tryCatch1 (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/util.js:64:19)
at Promise$_callHandler [as _callHandler] (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/promise.js:708:13)
at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/promise.js:724:18)
at Promise$_settlePromiseAt [as _settlePromiseAt] (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/promise.js:896:14)
at Promise$_fulfillPromises [as _fulfillPromises] (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/promise.js:1041:14)
at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/async.js:64:12)
at Async$consumeFunctionBuffer (/Users/benjaminrh/appem/node_modules/gulp-cache/node_modules/bluebird/js/main/async.js:37:14)
Ok. Kinda hard to troubleshoot with just that information. Can you provide a little more context? Perhaps a way I could reproduce it on my side?
Yeah! I'm wrapping it around my image minifier, the section from the gulp task looks like this:
return gulp.src(paths.images)
.pipe($.cache($.imagemin({
progressive: true,
interlaced: true
})))
.pipe(gulp.dest(paths.imageDist));
Removing the $.cache
there makes everything work normally.
same issue here, running gulp-imagemin 1.0.1, gulp-cache 0.2.2
Does anyone have a repo I could clone down to reproduce this with? My test repo running with gulp-imagemin 1.0.1 and gulp-cache 0.2.2 is not running into this.
You could also try clearing your cache and running the task again:
gulp.task('clear', function (done) {
return cache.clearAll(done);
});
Same problem for me with:
return gulp.src('app/images/**/*')
.pipe($.cache($.imagemin({
optimizationLevel: 3,
progressive: true,
interlaced: true
})))
.pipe(gulp.dest('build/images'))
.pipe($.size());
And ´gulp-imagemin@0.5.0´ `gulp-cache@0.1.11`
@Saturate Both of those modules are out of date, recommend upgrading and clearing your cache using the code I provided above.
Can't really debug any further on this unless someone gets me access to their repo to verify, or sets up a repo independently that reproduces the issue.
Thank you @BenjaminRH for the hint. I removed $.cache()
and it works now :)