gulp: TypeError: Cannot read property 'length' of undefined
Since today whenever I do a clean install of gulp I get the following error:
TypeError: Cannot read property 'length' of undefined
[10:38:42] TypeError: Cannot read property 'length' of undefined
at flattenGlob (/Users/miguel/src/reco2/node_modules/glob2base/index.js:9:25)
at setToBase (/Users/miguel/src/reco2/node_modules/glob2base/index.js:48:12)
at module.exports (/Users/miguel/src/reco2/node_modules/glob2base/index.js:56:19)
at Object.gs.createStream (/Users/miguel/src/reco2/node_modules/glob-stream/index.js:34:42)
at /Users/miguel/src/reco2/node_modules/glob-stream/index.js:80:17
at Array.map (native)
at Object.gs.create (/Users/miguel/src/reco2/node_modules/glob-stream/index.js:79:29)
at Gulp.src (/Users/miguel/src/reco2/node_modules/vinyl-fs/lib/src/index.js:33:23)
at Gulp.<anonymous> (/Users/miguel/src/reco2/gulpfile.js:13:8)
at module.exports (/Users/miguel/src/reco2/node_modules/orchestrator/lib/runTask.js:34:7)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 32
- Comments: 51 (5 by maintainers)
Commits related to this issue
- fix linux build — committed to microsoft/vscode by joaomoreno 8 years ago
This has been fixed upstream, delete
node_modules
and reinstall should work nowyeah, the chain is about 5 dependencies long. Didn’t think I needed to draw too much attention to the underlying issue 😃
For the curious, bug reference MoOx/reduce-css-calc#13
@delta98 commenting gulp-cssnano fixes it for me also
vinyl-fs dependency in gulp 3.9.1 is ^0.3.0.
cd node_modules/gulp
nano package.json
change vinyl-fs dep from ^0.3.0 to 2.4.3node_modules/gulp/npm install .
Get errors, but after updating vinyl-fs, gulp 3.9.1 seems to work.verify with
npm ls vinyl-fs thinglink@0.0.1 /Users/sulmanen/work/site └─┬ gulp@3.9.1 └── vinyl-fs@2.4.3
Seems to be a glob2base issue, and there’s a pull there https://github.com/contra/glob2base/pull/9/files
Same here:
Triggered by the call
gulp.src(options.src)
.options.src
being a path string valueSame here, the error seems to be triggered by any
gulp.src()
call : /Please react with the 👍 or 🎉 emoji on one of @TheSpyder’s messages instead of writing an appreciative comment, thank you! There are 18 participants in this thread, and you are sending all of them notifications / emails.
It makes no sense at all… but when we (Microsoft/vscode) comment out this line, which requires gulp-cssnano, the error goes away. It’s as if some dependency within
gulp-cssnano
interferes with some dependency withingulp
.@delta98 commenting
gulp-cssnano
fixes it for me@joaomoreno yeah, it stops the error, but something must have changed within the package, or cascades through that plugin. As @cfeeling says it’s not used on his project.
(my bad, wrong button)
I can confirm this, even with an empty task: