question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Something undefined

See original GitHub issue

EDIT

PokemonGO Servers down? 💯

Hello! I’m actually trying to create a simple web based Bot, and yeah. It’s a little bit strange, I don’t know what I did wrong. That’s a part of my “class”:

‘use strict’;

var PokemonGO = require(‘pokemon-go-node-api’);

const Logger = require(‘./Core/Logger.js’); const log = new Logger();

function Instance(provider, username, password, location) { log.dif(‘Starting PokémonGO NodeJS Bot, written by Kylon…’, ‘yellow’); if(provider !== null && username !== null && password !== null) { if(location !== null && typeof location == ‘object’) { var instance = new PokemonGO.Pokeio(); log.info(‘Trying to connect & initialize user…’); instance.init(username, password, location, provider, (err) => { if(err) { log.error(err); }

    log.suc('Successfully logged in!');

    log.info('Current location: ' + instance.playerInfo.locationName);
    log.info('lat/long/alt: ' + instance.playerInfo.latitude + '/' + instance.playerInfo.longitude + '/' + instance.playerInfo.altitude);

    log.suc('Trying to get user profile');
    instance.GetProfile((err, profile) => {
      if(err) {
        log.error(err);
      }

      // Logging user infos
      log.dif('=========================', 'yellow');
      log.info('Username: ' + profile.username);

and that’s what I’m getting in my console output:

[2016-07-27T16:36:28+02:00] Trying to connect & initialize user… [2016-07-27T16:36:29+02:00] Logging with user: xxx@gmail.com undefined [2016-07-27T16:36:29+02:00] Error: 403 error from server [2016-07-27T16:36:29+02:00] Successfully logged in! [2016-07-27T16:36:29+02:00] Current location: Times Square [2016-07-27T16:36:29+02:00] lat/long/alt: 40.759011/-73.9844722/0 [2016-07-27T16:36:29+02:00] Trying to get user profile

[2016-07-27T16:36:29+02:00] Error: Error

C:\Users\Frenk\Desktop\server\Instance.js:37 log.info('Username: ’ + profile.username); ^

TypeError: Cannot read property ‘username’ of undefined at C:\Users\Frenk\Desktop\server\Instance.js:37:42 at C:\Users\Frenk\Desktop\server\node_modules\pokemon-go-node-api\poke.io.js:240:16 at Request._callback (C:\Users\Frenk\Desktop\server\node_modules\pokemon-go-node-api\poke.io.js:131:16) at self.callback (C:\Users\Frenk\Desktop\server\node_modules\request\request.js:187:22) at emitOne (events.js:77:13) at Request.emit (events.js:169:7) at Request.init (C:\Users\Frenk\Desktop\server\node_modules\request\request.js:233:17) at new Request (C:\Users\Frenk\Desktop\server\node_modules\request\request.js:129:8) at request (C:\Users\Frenk\Desktop\server\node_modules\request\index.js:55:10) at C:\Users\Frenk\Desktop\server\node_modules\request\index.js:63:12

and that’s how I create the new instance:

var Instance = require(‘./Instance.js’); var pokemon = new Instance(‘google’, ‘mail’, ‘password’, { type: ‘name’, name: process.env.PGO_LOCATION || ‘Times Square’ });

Why I’m getting ‘undefined’ and btw. what’s undefined? The player object? Regards,

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
antonrez89commented, Jul 27, 2016

Hey, does anybody know how to get user level?

0reactions
necm1commented, Jul 28, 2016

@Armax would be awesome, if you can close it. For people w/ the same problem: https://github.com/Armax/Pokemon-GO-node-api/issues/94

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined Definition & Meaning - Dictionary.com
Undefined definition, without fixed limits; indefinite in form, extent, or application: undefined authority; undefined feelings of sadness. See more.
Read more >
50 Synonyms & Antonyms of UNDEFINED - Merriam-Webster
Synonyms for UNDEFINED: vague, hazy, undetermined, faint, nebulous, indistinct, unclear, indefinite; Antonyms of UNDEFINED: clear, definite, distinct, ...
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types.
Read more >
UNDEFINED | definition in the Cambridge English Dictionary
undefined meaning: 1. not clearly described, stated, ... The idea is to present something so undefined that the audience itself can decide ...
Read more >
Undefined Expressions & Numbers in Math - Study.com
Discover what an undefined expression in math is. ... Learn when a function is undefined with... ... Is 0 over something undefined?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found