{"action":"created","issue":{"url":"https://api.github.com/repos/workshopper/learnyounode/issues/136","repository_url":"https://api.github.com/repos/workshopper/learnyounode","labels_url":"https://api.github.com/repos/workshopper/learnyounode/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/workshopper/learnyounode/issues/136/comments","events_url":"https://api.github.com/repos/workshopper/learnyounode/issues/136/events","html_url":"https://github.com/workshopper/learnyounode/issues/136","id":46176036,"number":136,"title":"Make it modular: \"Your additional module file returned an error on its callback:\"","user":{"login":"vampsama","id":1202775,"avatar_url":"https://avatars.githubusercontent.com/u/1202775?v=3","gravatar_id":"","url":"https://api.github.com/users/vampsama","html_url":"https://github.com/vampsama","followers_url":"https://api.github.com/users/vampsama/followers","following_url":"https://api.github.com/users/vampsama/following{/other_user}","gists_url":"https://api.github.com/users/vampsama/gists{/gist_id}","starred_url":"https://api.github.com/users/vampsama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vampsama/subscriptions","organizations_url":"https://api.github.com/users/vampsama/orgs","repos_url":"https://api.github.com/users/vampsama/repos","events_url":"https://api.github.com/users/vampsama/events{/privacy}","received_events_url":"https://api.github.com/users/vampsama/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-18T14:07:28Z","updated_at":"2016-05-22T11:04:54Z","closed_at":"2014-10-19T06:30:25Z","body":"I bet there is some basic node/javascript Im missing that is causing this...\r\n\r\nverify result:\r\n```javascript\r\n                 ACTUAL                                  EXPECTED                 \r\n────────────────────────────────────────────────────────────────────────────────\r\n\r\n   \"CHANGELOG.md\"                      ==    \"CHANGELOG.md\"                     \r\n   \"LICENCE.md\"                        ==    \"LICENCE.md\"                       \r\n   \"README.md\"                         ==    \"README.md\"                        \r\n   \"\"                                  ==    \"\"                                 \r\n\r\n────────────────────────────────────────────────────────────────────────────────\r\n\r\n✓ Submission results match expected\r\n✓ Additional module file exports a single function\r\n✓ Additional module file exports a function that takes 3 arguments\r\n✓ Additional module file handles errors properly\r\n✓ Additional module file handles callback argument\r\n✗ Your additional module file [filteredls.js] returned an error on its callback:\r\n\t'CHANGELOG.md'\r\n✗ Your additional module file [filteredls.js] returned an error on its callback:\r\n\t'LICENCE.md'\r\n\r\n/usr/local/lib/node_modules/learnyounode/node_modules/workshopper-exercise/exercise.js:152\r\n    processors[i].call(self, mode, function (err, pass) {\r\n                  ^\r\nTypeError: Cannot call method 'call' of undefined\r\n    at next (/usr/local/lib/node_modules/learnyounode/node_modules/workshopper-exercise/exercise.js:152:19)\r\n    at /usr/local/lib/node_modules/learnyounode/node_modules/workshopper-exercise/exercise.js:159:7\r\n    at callback (/usr/local/lib/node_modules/learnyounode/exercises/make_it_modular/verify.js:25:15)\r\n    at modFileError (/usr/local/lib/node_modules/learnyounode/exercises/make_it_modular/verify.js:30:5)\r\n    at /usr/local/lib/node_modules/learnyounode/exercises/make_it_modular/verify.js:103:18\r\n    at /Users/john/learnyounode/filteredls.js:9:9\r\n    at Object.oncomplete (fs.js:107:15)\r\n```\r\nmakeitmodular.js:\r\n```javascript\r\nvar mymodule = require('./filteredls.js');\r\nmymodule(process.argv[2], process.argv[3], function(err, data){ \r\n  if(err){\r\n    console.log(err);\r\n  } else {\r\n    console.log(data);\r\n}\r\n});\r\n```\r\n\r\nfilteredls.js:\r\n```javascript\r\nmodule.exports = function (dirPath, filterString, callback){\r\n  var fs = require('fs');\r\n  fs.readdir(dirPath, function (err ,data){\r\n    if(err) {\r\n      return callback(err);\r\n    }\r\n    for(i = 0; i < data.length; i++){\r\n       if(data[i].split('.')[1] === filterString){\r\n        callback(data[i]);\r\n      }\r\n    }\r\n  });\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/workshopper/learnyounode/issues/comments/220826519","html_url":"https://github.com/workshopper/learnyounode/issues/136#issuecomment-220826519","issue_url":"https://api.github.com/repos/workshopper/learnyounode/issues/136","id":220826519,"user":{"login":"NeXTs","id":1753208,"avatar_url":"https://avatars.githubusercontent.com/u/1753208?v=3","gravatar_id":"","url":"https://api.github.com/users/NeXTs","html_url":"https://github.com/NeXTs","followers_url":"https://api.github.com/users/NeXTs/followers","following_url":"https://api.github.com/users/NeXTs/following{/other_user}","gists_url":"https://api.github.com/users/NeXTs/gists{/gist_id}","starred_url":"https://api.github.com/users/NeXTs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeXTs/subscriptions","organizations_url":"https://api.github.com/users/NeXTs/orgs","repos_url":"https://api.github.com/users/NeXTs/repos","events_url":"https://api.github.com/users/NeXTs/events{/privacy}","received_events_url":"https://api.github.com/users/NeXTs/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T11:04:54Z","updated_at":"2016-05-22T11:04:54Z","body":"same issue here, what may be wrong?\r\n\r\n```\r\nvar getFolder = require('./getFolder');\r\n\r\ngetFolder(process.argv[2], process.argv[3], function(err, result) {\r\n  if( ! err) console.log(result)\r\n})\r\n```\r\n\r\n```\r\nvar fs = require('fs');\r\nvar path = require('path');\r\n\r\nmodule.exports = function(dirname, extname, cb) {\r\n  if(extname[0] != '.') extname = '.' + extname;\r\n  fs.readdir(dirname, function(err, list) {\r\n    if(err) return cb(err);\r\n\r\n    list.forEach(function(item) {\r\n      if(path.extname(item) == extname) cb(null, item)\r\n    })\r\n  })  \r\n}\r\n```\r\n\r\n\r\n> C:\\Users\\me\\AppData\\Roaming\\npm\\node_modules\\learnyounode\\node_modules\\workshopper-exercise\\exercise.js:188\r\n    processors[i].call(self, mode, function (err, pass) {\r\n                 ^\r\nTypeError: Cannot read property 'call' of undefined"}}
{"actor":{"display_login":"NeXTs"}}