TS2739
error TS2739: Type ‘
{}
‘ is missing the following properties from type ‘Person
‘:age
,name
Broken Code ❌
1 |
|
Fixed Code ✔️
The object doesn’t have any properties, so it cannot be assigned to the type of Person
. We have to add the missing properties to fix this error:
1 |
|
Video Tutorial
TS2739: Type ‘string[]’ is missing the following properties from type ‘Promise ‘: then, catch, [Symbol.toStringTag]
Broken Code ❌
1 |
|
When your function specifies to return a Promise, you have to ensure that your return value is also wrapped in a Promise
:
1 |
|
Alternatively, you can make use of the async
keyword, which will automatically wrap your return value into a Promise
:
1 |
|