Cannot re-export name that is not defined in the module ‘promise.d.ts’

April 8, 2016 1 By admin_manish

TypeScript seems to have caused problems on the first line of promise.d.ts complaining that Promise cannot be exported as it is not defined in this file:
ERROR in [default] /path/to/project/node_modules/angular2/src/facade/promise.d.ts:1:9
Cannot re-export name that is not defined in the module.

I solved this problem by adding following line of code at line number 1 in /path/to/project/node_modules/angular2/src/facade/promise.d.ts
declare var Promise: PromiseConstructor;