Closed markgoodyear closed 10 years ago
Probably an issue with your stuff, no? The error is saying that task has no method 'cached' so your stuff didn't load it
These are the gulpfiles:
Manually load:
var gulp = require('gulp');
var cached = require('gulp-cached');
var jshint = require('gulp-jshint');
gulp.task('lint', function() {
return gulp.src("./src/*.js")
.pipe(cached('linting'))
.pipe(jshint())
.pipe(jshint.reporter())
});
Auto load:
var gulp = require('gulp');
var task = require("gulp-load-tasks")();
gulp.task('lint:autoload', function() {
return gulp.src("./src/*.js")
.pipe(task.cached('linting'))
.pipe(task.jshint())
.pipe(task.jshint.reporter())
});
Both use the same source files, but the with gulp-load-tasks
fails when using gulp-cached
. I've switched to manually defining the tasks for now, so it's not a big issue.
@markgoodyear Still a problem?
@Contra I've just tried it and yeah, same issue. The full error is this:
TypeError: Object #<Object> has no method 'cached'
at Gulp.<anonymous> (/Users/markgoodyear/Desktop/Gulp/gulpfile.js:211:13)
at module.exports (/Users/markgoodyear/Desktop/Gulp/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:31:7)
at Gulp.Orchestrator._runTask (/Users/markgoodyear/Desktop/Gulp/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/markgoodyear/Desktop/Gulp/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/markgoodyear/Desktop/Gulp/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at startGulp (/usr/local/lib/node_modules/gulp/bin/gulp.js:141:26)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:133:5
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
As soon as I use the non auto-loaded one, it works perfectly.
I don't do anything special in this module with the module name or anything. Would you mind debugging a bit inside gulp-load-tasks? I'm almost certain the issue would have to be there.
I noticed the plugin had updated (and changed name) so I've re-installed it and seems to run fine now.
Off topic of this issue, files don't seem to be getting cached, the lint task above always runs jshint without changing the file.
Open a new issue up for that. I use this plugin for jshint and haven't had any problems
When using
gulp-load-tasks
, I get this error:With the example from the homepage, the task looks like this:
Cheers!