TS2794

error TS2794: Expected 1 arguments, but got 0. Did you forget to include ‘void’ in your type argument to ‘Promise’?

Solution

When a Promise resolves with nothing, then you need to define this return type (void) in recent versions of TypeScript.

Bad Code ❌

1
await new Promise((resolve, reject) => { resolve(); });

Fixed Code ✔️

1
await new Promise<void>((resolve, reject) => { resolve(); });