GetStream / stream-video-flutter

Flutter Video SDK - Build your own video app experience using Dart, Flutter and the Stream Video Messaging API.
https://getstream.io/video/docs/flutter/
Other
37 stars 11 forks source link

[BUG] Unable to run application on web with latest versions #654

Closed dagyu closed 3 weeks ago

dagyu commented 4 weeks ago

Flutter version: 3.19.5

After running flutter pub upgrade, Flutter web no longer compiles. To replicate the error, simply execute the example you have in your repository. I followed these steps exactly:

  1. git clone --depth 1 --branch main https://github.com/GetStream/stream-video-flutter.git
  2. Created the .env file
  3. melos postclean
  4. melos bootstrap
  5. melos run generate:all
  6. cd packages/stream_video_flutter/example && flutter run -d chrome

And then this error occurs:

Launching lib/main.dart on Chrome in debug mode...
/Users/dagyu/.pub-cache/hosted/pub.dev/flutter_webrtc-0.9.48+hotfix.1/lib/src/web/rtc_video_renderer_impl.dart:119:50: Error: The type 'JSArray<MediaStreamTrack>' used in the
'for' loop must implement 'Iterable<dynamic>'.
 - 'Iterable' is from 'dart:core'.
        for (final track in _srcObject!.jsStream.getVideoTracks()) {
                                                 ^
/Users/dagyu/.pub-cache/hosted/pub.dev/flutter_webrtc-0.9.48+hotfix.1/lib/src/web/rtc_video_renderer_impl.dart:125:50: Error: The type 'JSArray<MediaStreamTrack>' used in the
'for' loop must implement 'Iterable<dynamic>'.
 - 'Iterable' is from 'dart:core'.
        for (final track in _srcObject!.jsStream.getAudioTracks()) {
                                                 ^
/Users/dagyu/.pub-cache/hosted/pub.dev/flutter_webrtc-0.9.48+hotfix.1/lib/src/web/rtc_video_renderer_impl.dart:167:50: Error: The type 'JSArray<MediaStreamTrack>' used in the
'for' loop must implement 'Iterable<dynamic>'.
 - 'Iterable' is from 'dart:core'.
        for (final track in _srcObject!.jsStream.getVideoTracks()) {
                                                 ^
!/.pub-cache/hosted/pub.dev/flutter_webrtc-0.9.48+hotfix.1/lib/src/web/rtc_video_renderer_impl.dart:175:50: Error: The type 'JSArray<MediaStreamTrack>' used in the
'for' loop must implement 'Iterable<dynamic>'.
 - 'Iterable' is from 'dart:core'.
        for (final track in _srcObject!.jsStream.getAudioTracks()) {
                                                 ^
../../stream_video/lib/src/webrtc/rtc_audio_api/rtc_audio_html.dart:27:30: Error: The argument type 'MediaStreamTrack/*1*/' can't be assigned to the parameter type
'MediaStreamTrack/*2*/'.
 - 'MediaStreamTrack/*1*/' is from 'package:web/src/dom/mediacapture_streams.dart' ('/Users/dagyu/.pub-cache/hosted/pub.dev/web-0.5.1/lib/src/dom/mediacapture_streams.dart').
 - 'MediaStreamTrack/*2*/' is from 'dart:html'.
  audioStream.addTrack(track.jsTrack);
                             ^
Waiting for connection from debug service on Chrome...             19.3s
Failed to compile application.

It's a very critical bug, please can you investigate as soon as possible.

Brazol commented 3 weeks ago

Hi @dagyu 👋 Thank you for reporting the issue. It was caused by an update to flutter_webrtc dependency in our latest release. We have since reverted the update and released a fix in v0.3.9.