TS7009
error TS7009: ‘new’ expression, whose target lacks a construct signature, implicitly has an ‘any’ type.
Broken Code ❌
1 |
|
Fixed Code ✔️
The resolve
function of a Promise
is not a constructor. You can use the new
keyword only with constructors, so the new
keyword has to be removed in order to fix the code:
1 |
|
Alternatively, you can make use of the constructor:
1 |
|