When I upgrade from angular 8 to angular 9, I am getting a wired error saying that "Type 'string[]' is not assignable to type 'string'." when I run "npm install", below is the code that is getting this error.
let A = "";
if(error instanceof HttpErrorResponse){
...
}else{
B.fromError(error).then(errors => {
A = errors.splice(0, 5).map(function(re) {
return res.toString();
});
console.log(A);
}
Ais of typestringbecause that's what you initialise it as. Later on you're trying to assign an array of strings to it. That's where the type conflict comes from.