bruz / meteor-github-api

node-github package adapted for Meteor
7 stars 4 forks source link

Example Doesn't Work #5

Open gh0st opened 7 years ago

gh0st commented 7 years ago

I'm probably going about this all wrong but don't I need to import the package into my project somehow? Using the example usage I get the following error:

client/imports/app/app.component.ts (19,29): Cannot find name 'GitHub'.

What am I doing wrong?

Meteor 1.4.2.3 Node 6.11.1

bruz commented 7 years ago

I tried to reproduce this with a simple test app but wasn't able to get this error, although I'm at Meteor 1.5.1 and Node 7.10.0. It's at https://github.com/bruz/meteor-github-api-example, if it helps having a known working example as a reference.

gh0st commented 7 years ago

So a little more curious after seeing the example. And maybe it's got something to do with the versions. I have in my server/main.ts

var github = new GitHub({
    version: "3.0.0",
    timeout: 5000
});

github.user.getFollowingFromUser({
    user: "ndhoule"
}, (err, res) => {
    console.log(JSON.stringify(res));
});

But when I run meteor I get

server/main.ts (57, 22): Cannot find name 'GitHub'.

And then it crashes, tries to boot again, throws another

server/main.ts (57, 22): Cannot find name 'GitHub'.

And then spits out my JSON.stringify like normal with login: anthonylewis. I can paste a full copy of the thrown exception. I see a 504: Gateway Timeout.

bruz commented 7 years ago

@gh0st could JS versus TypeScript be an issue? I'm not very familiar with TypeScript, but is dependency handling any different with that versus JS? I'm wondering about whether the way GitHub is globally exposed could be an issue.