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
Environment
If you are targeting an earlier version of JS, you will need a Promise polyfill. That's the source of the problem. RxJS does not include such a polyfill, so the Promise constructor does not exist and the error you reported is effected.
I'm not targeting an earlier version of JS (or trying to anyway), I'm just trying to get things working for node v11.6 which is the newest.
You should include a minimal repro with the exact settings that see the error effected. The SO question includes more than one set of tsconfig.json properties. TBH, if this is an issue at all, it looks like a TS issue and not an RxJS issue.
Not sure where the complexity is (the se had the conf and the code) but I'm happy to do it.
https://github.com/EvanCarroll/rxjsissue4448
@kwonoj @cartant
Now remove RxJS from your minimal repro and add the following instead:
type P = typeof Promise;
If the error is still effected, you can close this and report it in the TypeScript repo, instead.
Whelp, it is. I'll file the bug in TypeScript.
@cartant bug found tsc file.ts does not process typescript.conf
Yeah, that rings a bell. I think I've been bitten by that behaviour in the past.
https://twitter.com/TheEvanCarroll/status/1080899909522477061 (if you care to vote on it)
So what was the conclusion here? I'm getting the same error - followed here from stack overflow
@reed-lawrence The conclusion is that this is - as discussed above - not an RxJS issue.
Most helpful comment
Whelp, it is. I'll file the bug in TypeScript.