Giter VIP home page Giter VIP logo

Comments (4)

Shwheelz avatar Shwheelz commented on June 20, 2024
var oakdex = require('oakdex-pokedex');
oakdex.findPokemon(number, function(p) {
            console.log(p.names.en);
});
// cannot read property 'names' of undefined

from oakdex-pokedex.

jalyna avatar jalyna commented on June 20, 2024

@Shwheelz Please try again for the ruby gem (release 0.1.3). It should work now. Thanks for reporting the bug!

I will further investigate in the node package.

from oakdex-pokedex.

Shwheelz avatar Shwheelz commented on June 20, 2024

The rubygem is working great now, thanks! I'm still having trouble with the node package though. I'm trying to call within an Alexa skill that gives a Pokemon name, and the user has to guess one of the Pokemon's types. Because it's an Alexa skill, it's admittedly hard to debug. Here's the snippet that's throwing the error, as well as the stack trace below.

let prepareQuestions = function(pokemonList) {
    let questionList = [];
    for (let pokemon of pokemonList) {
        Oakdex.findPokemon(pokemon, function(p) {
            let types = p.types;      // This is the error line below (index.js:43:26)
            questionList.push({question: pokemon, answer: types})
        });
    }
    
    return questionList;
}

Here's the stack trace; perhaps it could be useful. I'll continue to poke around as I get time as well, and maybe we can solve this. I think your node package is really useful, and I'm hoping to get it to work so I can make Alexa skills with it in the future.

module initialization error: TypeError
    at /var/task/index.js:43:26
    at /var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:106:13
    at /var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:47:5
    at allByName (/var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:9:5)
    at pokemonById (/var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:43:3)
    at /var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:103:9
    at allByName (/var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:9:5)
    at Object.findPokemon (/var/task/node_modules/oakdex-pokedex/src/oakdex_pokedex.js:100:5)
    at prepareQuestions (/var/task/index.js:41:16)
    at Object.<anonymous> (/var/task/index.js:51:22)

from oakdex-pokedex.

Shwheelz avatar Shwheelz commented on June 20, 2024

It appears all your node packages are passing, so I'm going to close the issue until I have ample time to debug my own app. Thanks again for fixing the Rubygem though! Great work!

from oakdex-pokedex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.