TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Typescript Promise duplicate issue

Open cknightdevelopment opened this issue 11 years ago • 2 comments

I have been having a heck of a time getting es6 promises to work with Typescript in a ASP.NET 5 project. I installed the es6-promise.d.ts via tsd install es6-promise. However, I get errors about Promise being duplicated. When I hover on the Promise declaration in the es6-promise.d.ts file, I get the error below (see the blue section ac the bottom of the image). It seems to be conflicting with some typescript definition file from a Microsoft SDK, which is obviously not part of my project.

error

Does anyone have an idea on why this might be happening or how I can fix this?

cknightdevelopment avatar Dec 03 '15 19:12 cknightdevelopment

Are your build settings targeting ES6/ES2015? If so, that's the issue. You're getting the definition of Promise from our lib.es6.d.ts, in which case, you shouldn't need es6-promise.d.ts in theory.

DanielRosenwasser avatar Dec 03 '15 19:12 DanielRosenwasser

Thanks, that makes sense. This question can be closed.

cknightdevelopment avatar Dec 03 '15 22:12 cknightdevelopment