You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am receiving the following types of error in the contact.service.ts script. I am receiving four different errors of these type one for each of the following methods getContacts(), createContact(...), deleteContact(...), updateContact(...). I am using visual code, which is how I identified the error below.
severity: 'Error'
message: 'Type 'Promise<void | Contact[]>' is not assignable to type 'Promise<Contact[]>'.
Type 'void | Contact[]' is not assignable to type 'Contact[]'.
Type 'void' is not assignable to type 'Contact[]'.'
at: '17,7'
source: 'ts'
The text was updated successfully, but these errors were encountered:
Good catch! Looks like handleError returns <void>. Since handleError catches errors in the promises, the promise types should be <void | Contact[]> etc.
So you should be safe to just edit your file to correct this. (See the fix here)
Hello, I am receiving the following types of error in the contact.service.ts script. I am receiving four different errors of these type one for each of the following methods getContacts(), createContact(...), deleteContact(...), updateContact(...). I am using visual code, which is how I identified the error below.
severity: 'Error'
message: 'Type 'Promise<void | Contact[]>' is not assignable to type 'Promise<Contact[]>'.
Type 'void | Contact[]' is not assignable to type 'Contact[]'.
Type 'void' is not assignable to type 'Contact[]'.'
at: '17,7'
source: 'ts'
The text was updated successfully, but these errors were encountered: