boardgamegeekjsclient icon indicating copy to clipboard operation
boardgamegeekjsclient copied to clipboard

Unexpected end of JSON input when using collection endpoint with large collection

Open GamerKingFaiz opened this issue 4 years ago • 1 comments

I have made the following endpoint in my express server:

const getBggCollection = (req, res) => {
  const { username } = req.params;
  client.collection
    .query({
      username: username,
      own: 1,
      excludesubtype: "boardgameexpansion",
    })
    .then((result) => {
      console.log(result);
      res.send(result);
    });
};

I'm testing larger collections to makes sure this library handles them seamlessly. Unfortunately I've run into an issue where I get the following error when testing in Chrome. image

In the screenshot above my test username is hermi and it just keeps erroring out. I also tested Alan How and the first time I queried that username it gave the above error, but the second time it seemed to return normally (barring the error in #19).

I'm using the usernames collected in this BGG Thread for large collection testing. Let me know if you need further information!

GamerKingFaiz avatar Jan 26 '22 01:01 GamerKingFaiz

Problem come from Boardgamegeek itself bggresp Not sure, but i think that something is changing at their backend.

Catching this error have to be implemented.

LearningProcesss avatar Jan 28 '22 22:01 LearningProcesss