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:
git clone --depth 1 --branch main https://github.com/GetStream/stream-video-flutter.git
Created the .env file
melos postclean
melos bootstrap
melos run generate:all
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.
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.
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:git clone --depth 1 --branch main https://github.com/GetStream/stream-video-flutter.git
melos postclean
melos bootstrap
melos run generate:all
cd packages/stream_video_flutter/example && flutter run -d chrome
And then this error occurs:
It's a very critical bug, please can you investigate as soon as possible.