Comments (4)
var oakdex = require('oakdex-pokedex');
oakdex.findPokemon(number, function(p) {
console.log(p.names.en);
});
// cannot read property 'names' of undefined
from oakdex-pokedex.
@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.
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.
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)
- Add wings
- Add drinks
- Add Sacred Ash
- Add Ability Capsule
- Add Flutes
- Add Shards
- Add Battle Items
- Add all TMs & HMs
- Add Meltan/Melmetal
- Add Let's Go Pikachu/Eevee new moves HOT 1
- Add Partner Pikachu/Eevee from Let's Go Pikachu/Eevee
- Add LGPE move learnsets for 1-151
- Add LGPE pokedex entries for 1-151
- Add tutor moves
- Provide TypeScript definitions
- all pokemons in one json
- Will this get updated with the new Sword & Shield game data?
- .names HOT 2
- Move to CircleCI
- .findPokemon() Issue ID
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oakdex-pokedex.