Mendeley / mendeley-python-sdk

Python SDK for the Mendeley API.
Apache License 2.0
119 stars 59 forks source link

NPM package doesnt work #29

Open mebibou opened 3 years ago

mebibou commented 3 years ago

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?)