Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't create object of PokeApi.. #20

Open
csfragsta opened this issue Jan 2, 2018 · 9 comments
Open

I can't create object of PokeApi.. #20

csfragsta opened this issue Jan 2, 2018 · 9 comments

Comments

@csfragsta
Copy link

When i run the following piece of code, I get the following error:

`const Poke = new PokeAPI(options);
^

TypeError: PokeAPI is not a constructor
at Object. (F:\Discord\mybot\pogo.js:17:14)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3`

Can someone pls assist me with this issue? I am new to PokeApi..if this is not the correct api to use currently, then pls point me to correct API.

@st0ffern
Copy link
Collaborator

st0ffern commented Jan 2, 2018

did you import the lib?

import PokeAPI from 'pokemongo-api'

@csfragsta
Copy link
Author

Yes I did:

const PokeAPI = require('pokemongo-api');

@st0ffern
Copy link
Collaborator

st0ffern commented Jan 2, 2018

You may need to change that to:

const PokeAPI = require('pokemongo-api').default;

@csfragsta
Copy link
Author

Thanks, Now it works but is unable to login. Say's the following. What might be the issue?

[!] Endpoint missing in request, lets try again.. in 5 seconds

@st0ffern
Copy link
Collaborator

st0ffern commented Jan 2, 2018

well this repo is outdated, and i do not maintain it 😞

@csfragsta
Copy link
Author

Lol you could have said me that earlier...that's sad though...Can you point me to a working repo?

@st0ffern
Copy link
Collaborator

st0ffern commented Jan 2, 2018

nope 🤣

@csfragsta
Copy link
Author

[i] Received PTC access token!
[i] Login cache saved to file!
[!] Endpoint missing in request, lets try again.. in 5 seconds
[!] Endpoint missing in request, lets try again.. in 5 seconds
[!] Endpoint missing in request, lets try again.. in 5 seconds
[!] Endpoint missing in request, lets try again.. in 5 seconds

How can i solve this issue? :(

@st0ffern
Copy link
Collaborator

crack the newest update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants