scratch-api icon indicating copy to clipboard operation
scratch-api copied to clipboard

Using Scratch.UserSession.load causes JSON error

Open ghost opened this issue 4 years ago • 0 comments

Here is the code I used:

Scratch.UserSession.load(function(err, user) {
  if (err) return console.error(err)
  user.cloudSession(642505948, function(err, cloud) {
    if(err) return console.error(err)
    cloudSession = cloud
  });
});

Here is the error:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /home/runner/scratch-cloud-setter/node_modules/scratch-api/scratchapi.js:99:23
    at IncomingMessage.<anonymous> (/home/runner/scratch-cloud-setter/node_modules/scratch-api/scratchapi.js:37:37)

ghost avatar Feb 11 '22 22:02 ghost