alanshaw / david

:eyeglasses: Node.js module that tells you when your package npm dependencies are out of date.
https://david-dm.org
MIT License
969 stars 70 forks source link

invalid json response body... #174

Closed Martii closed 3 years ago

Martii commented 3 years ago

Still not quite sure if this should be at david-dm or not... but got this once and here goes:

FetchError: invalid json response body at https://david-dm.org/OpenUserJS/OpenUserJS.org/project.json reason: Unexpected token u in JSON at position 0
    at /home/node/app/node_modules/node-fetch/lib/body.js:48:31
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at async Promise.all (index 0)

Refreshed the page and it came up with the expected results.

Thanks for the look.

antongolub commented 3 years ago

Hi there,

Faced the same trouble. It seems like this is david-www's issue. Mentioned https://david-dm.org/OpenUserJS/OpenUserJS.org/project.json looks like:

Failed to get manifest: {"message":"API rate limit exceeded for user ID 4216669.","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Not sure, but probably crawler does not properly handle github's rate-limit restrictions. As we can see, It uses src/lib/github.js#L1 old and deprecated github client, and this may be the reason.

https://www.npmjs.com/package/@octokit/rest https://www.npmjs.com/package/@octokit/plugin-throttling

alanshaw commented 3 years ago

Should be fixed now, please shout if it happens again.