scratch-api
scratch-api copied to clipboard
Using Scratch.UserSession.load causes JSON error
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)