Closed Graham42 closed 10 years ago
@Graham42 I would expect that to throw if you then referenced $.xy
- this is because plugins are lazily loaded.
That said, I wouldn't recommend using gulp-load-plugins for loading all your plugins in anyway, that's not what it's designed for.
In that case it's probably working as intended. Feel free to close this if it's only meant to work with modules like gulp-*
.
I confirmed it works for gulp plugins but not for others. For example for module fs
I get this stacktrack and nothing about not finding a module.
TypeError: Object #<Object> has no method 'readdirSync'
at getFolders ( <my_project_directory> /gulp/build.js:16:15)
at Gulp.buildParts ( <my_project_directory> /gulp/build.js:39:16)
at module.exports ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at Gulp.<anonymous> ( <my_project_directory> /gulp/build.js:61:7)
at module.exports ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep ( <my_project_directory> /node_modules/gulp/node_modules/orchestrator/index.js:214:10)
@Graham42 it is only expected to work with gulp plugins but it seems odd that it would break for others. Can you show me the code that's generating that error?
Was having a really hard time reproducing and then realized I had a typo. Sorry! The issue was actually between the keyboard and the chair.
Can you make it an option to throw an erorr if a module is not installed?
Normally
var xy = require('xy')
Would throwError: Cannot find module 'xy'
ifxy
is not installedBut if I do
No error is thrown