error TS2585: ‘Promise’ only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.

Bug Report

error TS2585: ‘Promise’ only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the lib compiler option to es2015 or later.

Current Behavior

node_modules/rxjs/internal/Observable.d.ts:82:59 - error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.                                                                   

82     toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;                                                                    
                                                             ~~~~~~~


Found 1 error.

Reproduction

  • REPL or Repo link:

https://stackoverflow.com/questions/54014405/ts2585-promise-only-refers-to-a-type-but-is-being-used-as-a-value-here?noredirect=1#comment94866023_54014405

Environment

  • Runtime: Node 11.6
  • RxJS version: 6.3.3

see https://stackoverflow.com/questions/54014405/ts2585-promise-only-refers-to-a-type-but-is-being-used-as-a-value-here?noredirect=1#comment94866023_54014405

1 possible answer(s) on “error TS2585: ‘Promise’ only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.