Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPlayers endpoint returns an error #16

Open
taylorbourne opened this issue Jul 27, 2021 · 0 comments
Open

getPlayers endpoint returns an error #16

taylorbourne opened this issue Jul 27, 2021 · 0 comments

Comments

@taylorbourne
Copy link

This is the request I'm running:

  nhl.getPlayer({
    name: "wayne"
  }).then(players => {
    console.log('huh', players)
    res.status(200).json({ players })
  }).catch(error => {
    console.log('error ', error)
    res.status(500)
  })

Basically just trying to fetch a player using just the name property – but I'm getting a type error. Any help is much appreciated.

 TypeError: Cannot read property 'some' of undefined
    at /Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/util/index.js:26:23
    at Array.filter (<anonymous>)
    at Object.exports.getId (/Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/util/index.js:25:27)
    at Object.exports.handleUrl (/Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/util/index.js:45:23)
    at Object.<anonymous> (/Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/player/index.js:15:32)
    at Generator.next (<anonymous>)
    at /Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/player/index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/player/index.js:4:12)
    at Object.getPlayer (/Users/taylorbourne/_PROJECTS/_NAMESAUCER/_WEB/namesaucer/node_modules/@nhl-api/client/lib/src/player/index.js:14:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant