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

NPM package doesnt work #29

Open
mebibou opened this issue Jan 6, 2021 · 0 comments
Open

NPM package doesnt work #29

mebibou opened this issue Jan 6, 2021 · 0 comments

Comments

@mebibou
Copy link

mebibou commented Jan 6, 2021

Since the node package repo is not public (for what reason?), I am logging this here.

When doing a catalog search:

const api = mendeley({
  authFlow: mendeley.Auth.clientCredentialsFlow({
    clientId: 'clientId',
    clientSecret: 'clientSecret',
    redirectUri:'redirectUri'
  })
});
await api.search.catalog({ title: 'Nitrogen loss from fertilizers applied to maize, wheat and rice in the North China Plain' })

This will fail:

TypeError: Cannot read property 'trim' of undefined
    at extractLinkHeaders ([...]/node_modules/@mendeley/api/lib/request.js:184:25)
    at Request.onDone ([...]/node_modules/@mendeley/api/lib/request.js:125:37)

Even though when I check the reponse data, it contains 10 results with the first result the one I'm looking for. But it's trying to extract this link headers and fails

Some other titles do not cause this issue, but many do, and it's quite the bugger (also please have the node sdk as public so people can log issues?)

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