kaizensoze/node-github

Running the example: TypeError: self.handler is not a function

Closed this issue · 5 comments

The example seems to not work properly :

> var GitHubApi = require("github4");
undefined
> 
> var github = new GitHubApi({
...     // required
...     version: "3.0.0",
...     // optional
...     debug: true,
...     protocol: "https",
...     host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub
...     pathPrefix: "/api/v3", // for some GHEs; none for GitHub
...     timeout: 5000,
...     headers: {
.....         "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent
.....     }
... });
undefined
> github.user.getFollowingFromUser({
...     // optional:
...     // headers: {
.....     //     "cookie": "blahblah"
.....     // },
...     user: "defunkt"
... }, function(err, res) {
...     console.log(JSON.stringify(res));
... });
TypeError: self.handler is not a function
    at Object.self.(anonymous function).(anonymous function) [as getFollowingFromUser] (/home/zedtux/Developments/grrn/node_modules/github4/index.js:352:30)
    at repl:1:13
    at REPLServer.defaultEval (repl.js:248:27)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:412:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:210:10)
    at REPLServer.Interface._line (readline.js:549:8)
> %

I was in the middle of refactoring and might've accidentally merged something I shouldn't have before publishing the latest version. I'll try to have it fixed tonight. Sorry about that.

Thank you @kaizensoze for the quick reply.

Should be fixed now. Try pulling down 0.2.10 from npm. Also, try creating a test auth token and plugging that into examples/example.js and let me know if that works ok. I'm probably going to clean out the other examples.

Okay thank you. I'll try it as soon as possible (After Christmas I guess.)

Closing for now. Feel free to create another ticket if you're still seeing the issue.