Skip to content

Conversation

@shama
Copy link
Member

@shama shama commented Oct 15, 2014

If you have a task that is configured to read targets as functions, it works fine. But when verbose is enabled, the function gets treated as a src array here: https://github.com/shama/grunt/blob/master/lib/grunt/task.js#L199

and produces the error:

TypeError: Object function () {
      } has no method 'indexOf'
    at /Users/Kyle/Documents/www/grunt-gulp/node_modules/grunt/lib/grunt/file.js:55:29
    at Array.forEach (native)
    at processPatterns (/Users/Kyle/Documents/www/grunt-gulp/node_modules/grunt/lib/grunt/file.js:53:34)
    at Object.file.expand (/Users/Kyle/Documents/www/grunt-gulp/node_modules/grunt/lib/grunt/file.js:110:17)
    at Object.fn [as src] (/Users/Kyle/Documents/www/grunt-gulp/node_modules/grunt/lib/grunt/task.js:180:36)
    at /Users/Kyle/Documents/www/grunt-gulp/node_modules/grunt/lib/grunt/task.js:199:24
    at Array.forEach (native)
    at Task.task.normalizeMultiTaskFiles (/Users/Kyle/Documents/www/grunt-gulp/node_modules/grunt/lib/grunt/task.js:196:11)

This PR just ignores any pattern that is a function as I think that is the most robust way to avoid hitting this hard error. Thanks!

Ref shama/grunt-gulp#1

@vladikoff vladikoff added this to the 0.4.6 milestone Oct 16, 2014
@shama shama added the ready label Nov 24, 2015
Base automatically changed from master to main March 22, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants