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
{{ message }}
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.
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(); }); }
The text was updated successfully, but these errors were encountered:
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(); }); }
The text was updated successfully, but these errors were encountered: