TypeError: Cannot read property 'WildPokemon' of undefined
See original GitHub issueI get this error after a successful login
macbookproloreto:PokemonGo-node-api admin$ node example.js
[i] Logging with user: xxxx@gmail.com
[i] Logging with user: xxxx@gmail.com
[i] Received Google access token!
[i] Received Google access token!
[i] Received API Endpoint: https://pgorelease.nianticlabs.com/plfe/100/rpc
[i] Current location: Times Square
[i] lat/long/alt: : 40.759011 -73.9844722 0
[i] Received API Endpoint: https://pgorelease.nianticlabs.com/plfe/100/rpc
1[i] Current location: Times Square
1[i] lat/long/alt: : 40.759011 -73.9844722 0
[i] Logged in!
[i] Username: Ladalisa
[i] Poke Storage: 250
[i] Item Storage: 350
[i] Pokecoin: 0
[i] Stardust: 200
[i] Logged in!
1[i] Username: Ladalisa
1[i] Poke Storage: 250
1[i] Item Storage: 350
1[i] Pokecoin: 0
1[i] Stardust: 200
1[+] There is a Weedle at 200 meters
1[+] There is a Voltorb at 200 meters
1[+] There is a Pidgey at 200 meters
1[+] There is a Rattata at 200 meters
[+] There is a Weedle at 200 meters
[+] There is a Voltorb at 200 meters
[+] There is a Pidgey at 200 meters
[+] There is a Rattata at 200 meters
/PokemonGo-node-api/example.js:105
for (var j = hb.cells[i].WildPokemon.length - 1; j >= 0; j--)
^
TypeError: Cannot read property 'WildPokemon' of undefined
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Pokemon API Uncaught TypeError: Cannot read property '0' of ...
When you try to access sprites[0] , sprites is undefined , since the data hasn't been loaded yet. one way to solve this...
Read more >poke api cannot read properties of undefined - You.com
Pokemon Api: TypeError: Cannot read property 'type' of undefined ... If I put wildPokemon.name , I'll get the name of the pokemon, which...
Read more >Cannot read properties of undefined' - JavaScript Debugging
JavaScript Tutorial. How To Fix 'Uncaught TypeError : Cannot read properties of undefined ' - JavaScript Debugging. 26K views 6 months ago.
Read more >Cannot read property 'map' of undefined | by May Guo - Medium
I wanted to pull in all the Pokemon and display them in cards. I used useState to set my pokemons variable to an...
Read more >Uncaught TypeError: Cannot read property 'find' of undefined
I am getting a TypeError, while it should not be as I believe I have the variables properly defined im creating a new...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
First I would advise against using the example.js exactly as written. If you do not intend to login with 2 unique accounts, you should get rid of the duplicated code and login only once.
Secondly, there is a bug on line 105 where
i
is defined as being outside the range ofhb.cells
. I can put up a PR later unless someone else beats me to it.We should be able to close this now.