dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.06k stars 1.56k forks source link

MediaDevices.enumerateDevices() crashes runtime #35282

Open ghost opened 5 years ago

ghost commented 5 years ago

This is reproducible on DartPad, which is currently running Dart SDK 2.1.0. Error message is "TypeError: Instance of 'JSArray': type 'JSArray' is not a subtype of type 'FutureOr<List>'".

This is on Chrome 70.0.3538.110 on OSX 10.14.1

See https://dartpad.dartlang.org/d2c410232a233d2c57605dc3583a52f5 for an example. Running this script results in an error in the Chrome developer console, and no error in the DartPad results console.

vsmenon commented 5 years ago

@terrylucas

Here's the example.

import 'dart:html';

void main() async {
  await window.navigator.mediaDevices.enumerateDevices();
}
ghost commented 5 years ago

Any update on this? This is pretty frustrating that a basic API method just doesn't work. :(