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
// es2018 feature on Promise Type (correct error behavior)newPromise(()=>{}).finally();// es2020 feature on PromiseConstructor Type (wrong error behavior)Promise.allSettled([]);// esnext feature on PromiseConstructor Type (wrong error behavior)Promise.any([]);
Expected behavior:
Property 'allSettled' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the lib compiler option to 'es2020' or later.
Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the lib compiler option to 'esnext' or later.
Actual behavior:
Property 'allSettled' does not exist on type 'PromiseConstructor'.
Property 'any' does not exist on type 'PromiseConstructor'.
Vboivin
changed the title
Better PromiseConstructor error message for newer versions of ECMAScript
PromiseConstructor error message is not using the correct format for newer versions of ECMAScript
Oct 5, 2020
TypeScript Version: Nightly
Search Terms:
Code
Expected behavior:
Property 'allSettled' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the lib compiler option to 'es2020' or later.
Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the lib compiler option to 'esnext' or later.
Actual behavior:
Property 'allSettled' does not exist on type 'PromiseConstructor'
.Property 'any' does not exist on type 'PromiseConstructor'
.Playground Link:
Related Issues:
How To Resolve
TypeScript/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts
Line 38 in 61aadc4
TypeScript/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts
Line 44 in 61aadc4
The text was updated successfully, but these errors were encountered: