Typescript is giving me a compilation error with the following code:
console.log('YHISTORY:login: data = '+data);
let theData = JSON.parse(data);
console.log('YHISTORY:login: theData = '+JSON.stringify(theData));
It complains when compiling the second line as follows:
Error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'
When I run this code the first line generates this console output:
YHISTORY:login: data = {"key":"4ba9f2eec3a59e76799a728f0dcda831b7f1fb66"}
The third line does not produce any console output. The following error is generated:
EXCEPTION: Error: Uncaught (in promise): TypeError: this is null