Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'? #35

Closed
KBryan opened this issue Jun 21, 2021 · 0 comments

Comments

@KBryan
Copy link
Contributor

KBryan commented Jun 21, 2021

The following error Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'? is found in buttons.ts.

Problem:
In newer versions of TypeScript 4.1.x the following syntax is not supported and will produce the above error.
function removeAllButtons() { return new Promise((resolve, reject) => { shownButtons.forEach(button => button.hide()); shownButtons = []; resolve(); }); }
Fix:
resolve is unknown in this context I assume and thus the following syntax works without error.
function removeAllButtons() { return new Promise<void>((resolve, reject) => { shownButtons.forEach(button => button.hide()); shownButtons = []; resolve(); }); }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant