-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lib.d.ts BUG] navigator.mediaDevices.getUserMedia returns PromiseLike (actually returns a Promise) #10242
Comments
I am using TypeScript 2, and got same error, originally asked on Stack Overflow maiermic's answer:
|
To fix this we will need to put Promise in lib.d.ts; but looks needed. |
So we should get an ES6 version of the |
We still need promislike. Let's talk about this. Maybe we should just make es6 the default. |
Has there been any movement on this? This is a long standing issue at this point. |
ES2015 as the default might make sense, there are already a lot of features in |
So the quick fix is the following: # TS 2.x only
npm install --save @types/webrtc (just sayin for newcomers on the issue) |
@Nek- No, that does not fix the issue. Inside of VS Code it correctly resolves the types from We use that types package and we had to explicitly add |
Any known workaround for this issue? For now I just don't catch exceptions and let them land in the browser console, which gets the job done but still doesn't seem right as I should really be able to catch it from my Promise. |
I'm having this issue as well. @prencher could you provide a bit more context for your as Promise fix? |
Duplicate of #13947 |
I should clarify, the generator converts |
TypeScript Version: atom-typescript
Code
Expected behavior:
Acording to MDN, navigator.mediaDevices.getUserMedia returns a
Promise
(with a catch method), not aPromiseLike
(without catch method).Actual behavior:
navigator.mediaDevices.getUserMedia returns a
PromiseLike<MediaStream>
It needs to return a
Promise<MediaStream>
The text was updated successfully, but these errors were encountered: