Typescript: Cannot find name 'MediaRecorder'.

Created on 25 Oct 2019  路  5Comments  路  Source: microsoft/TypeScript

image

Unactionable

Most helpful comment

While I completely agree with following issue templates, I think it's worth mentioning that this issue is now near the top of search results for "cannot find name MediaRecorder". That's how I got here (yes, I could have gone to DefinitelyTyped and checked for MediaRecorder, but sometimes you google things).

Point is, despite being an unactionable issue that probably never should have been opened, it now serves a useful purpose as unintentional documentation, answering the simple question of which package is needed to add types for MediaRecorder.

Sometimes things work out in ways you would not have expected. This is one of the reasons that I am a firm believer in showing appreciation for all issues that aren't obviously spam. So thanks @leishenglin.

All 5 comments

You can get types for MediaRecorder by installing the types package:
@types/dom-mediacapture-record

On another note (personal opinion here), it's quite disrespectful to open such an issue. The "New Issue" page explicitly states that questions go to Stack Overflow. If you believe this to be a bug, there's an entire bug template which you've ignored and replaced with an image. Help others help you.

image

While I completely agree with following issue templates, I think it's worth mentioning that this issue is now near the top of search results for "cannot find name MediaRecorder". That's how I got here (yes, I could have gone to DefinitelyTyped and checked for MediaRecorder, but sometimes you google things).

Point is, despite being an unactionable issue that probably never should have been opened, it now serves a useful purpose as unintentional documentation, answering the simple question of which package is needed to add types for MediaRecorder.

Sometimes things work out in ways you would not have expected. This is one of the reasons that I am a firm believer in showing appreciation for all issues that aren't obviously spam. So thanks @leishenglin.

Now that is really a respectful comment coming from you @timmywil . Congratulations!!!
And thanks @leishenglin I hit the same problem as you.

How is this unactionable? As a user, if I have access to HTMLElement with no third-party dependencies I would expect MediaRecorder to also be here. In fact, I expected everything stated on this page: https://developer.mozilla.org/en-US/docs/Web/API to be included by default. Why? because everything else I used is included by default, this is how the human brain works. I think an average user encountering this issue would not consider it a question. All the comments saying "please use the template. please post questions to StackOverflow" is like saying "please be happy and not be a loser".

Anyways, here's an actionable suggesting: do a scrape on page: https://developer.mozilla.org/en-US/docs/Web/API, and if there are items not built-in in typescript, change the error message to: "We know this is a built-in browser feature, but we don't have it in typescript by default, please consider installing third-party dependencies".

Was this page helpful?
0 / 5 - 0 ratings