LoginSignup
1
0

More than 5 years have passed since last update.

gulpで「Error: Invalid glob argument: undefined」エラーが出た時に解決した方法

Posted at

gulpgile.jsをいじっていたらエラーが出て解決に時間がかかったが、結果的に本当に単純なミスだった。

エラーの内容は以下

Error: Invalid glob argument: undefined
    at Gulp.src (/xxxx/xxxx/xxxx/node_modules/vinyl-fs/lib/src/index.js:20:11)
    at Gulp.<anonymous> (/xxxx/xxxx/xxxx/gulpfile.js:103:7)
    at module.exports (/xxxx/xxxx/xxxx/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/xxxx/xxxx/xxxx/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/xxxx/xxxx/xxxx/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/xxxx/xxxx/xxxx/node_modules/orchestrator/index.js:134:8)
    at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
    at nextTickCallbackWith0Args (node.js:453:9)
    at process._tickCallback (node.js:382:13)

原因がわからずにnode_modulesを再インストールしたりなどいろいろ試したけど解決せず。
なんやかんやで数時間かかってふと気付いた、
呼び出した変数の名前が間違っていたという単純なミス!

var paths = {
'sassDir' : 'dev/scss/**/*.scss',
};


{中略}
gulp.src(paths.sassSrc)
{中略}

var paths = {
'sassDir' : 'dev/scss/**/*.scss',
};


{中略}
gulp.src(paths. sassDir)
{中略}

エラーの内容から原因がわからずにものすごく時間を無駄にしてしまいました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0