Closed designgears closed 8 years ago
If I disable caching on the getJSON function everything works fine.
const cachedResult = cache.get(url);
to
const cachedResult = null;
It seems to only happen on getPokemonByName. getPokemonSpeciesByName and getEvolutionChainById don't have this issue from my limited testing.
Thanks @designgears for pointing it out. You are right. Caching right now does not work pretty well. It returns directly the result instead of a Promise with the result. That's why happens that error happens.
Could you please test this fork: https://github.com/karlbright/pokedex-promise-v2 I am pretty sure that does work. I'm only waiting for a pull request from that guy
Thanks
Testing that fork, everything seems to work as expected now!
I just started running into this today, if I call the function more than once it will throw this error. Any ideas what might be going on?