supabase-flutter icon indicating copy to clipboard operation
supabase-flutter copied to clipboard

Error in console for realtime DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Binding>'

Open cristiandonaraDEV opened this issue 9 months ago • 3 comments

Describe the bug Unknown console error when initializing the realtime listener

To Reproduce Steps to reproduce the behavior:

  1. Just initialize a real-time listener even with no callback logic

Expected behavior No error should be in console, but shows DartError: TypeError: Instance of 'JSArray< dynamic >': type 'List< dynamic >' is not a subtype of type 'List< Binding >'

Screenshots Image

Version (please complete the following information): ├── supabase_flutter 2.8.4 │ ├── supabase 2.6.3 │ │ ├── functions_client 2.4.1 │ │ ├── gotrue 2.11.1 │ │ ├── postgrest 2.4.1 │ │ ├── realtime_client 2.4.2 │ │ ├── storage_client 2.3.1

Additional context Supabase.instance.client .channel('public:name') .onPostgresChanges( event: PostgresChangeEvent.all, schema: 'public', table: 'name', callback: (payload) {}, ) .subscribe();

cristiandonaraDEV avatar Mar 06 '25 11:03 cristiandonaraDEV

Do you just run the application in web, and you see the error, or do you run a hot-restart before seeing the error? For me, it required a hot-restart to reproduce this issue.

Vinzent03 avatar Mar 27 '25 21:03 Vinzent03

@Vinzent03 Just run

cristiandonaraDEV avatar Mar 29 '25 10:03 cristiandonaraDEV

I still cannot reproduce your issue without a hot-restart. Could you please elaborate a bit more about how you reproduce it? Does it happen immediately or some minutes later? I'm a bit confused that the error happens due to a reconnect. So somehow your connection is not stable, or you disconnect manually? Please create a full example and verify you are still able to reproduce the issue.

Vinzent03 avatar Mar 31 '25 11:03 Vinzent03

Related to #1122.

geoextra avatar Apr 04 '25 14:04 geoextra

I can reproduce the issue after a hot-restart in my own project without a hot-restart. Tested in 2.6.0, 2.8.2 and 2.8.4. I also similar errors for table subscriptions:

DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Map<String, dynamic>>'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 307:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39                 _failedAsCheck
dart-sdk/lib/_internal/js_shared/lib/rti.dart 1554:3                              _generalAsCheckImplementation
packages/rxdart/src/subjects/subject.dart 135:14                                  add
packages/supabase/src/supabase_stream_builder.dart 326:7                          [_addStream]
packages/supabase/src/supabase_stream_builder.dart 183:19                         <fn>
packages/realtime_client/src/realtime_channel.dart 311:35                         <fn>
packages/realtime_client/src/realtime_channel.dart 724:22                         trigger
packages/realtime_client/src/realtime_client.dart 378:40                          <fn>
dart-sdk/lib/core/iterable.dart 348:29                                            forEach
packages/realtime_client/src/realtime_client.dart 377:53                          <fn>
packages/realtime_client/src/realtime_client.dart 160:21                          <fn>
packages/realtime_client/src/realtime_client.dart 361:11                          onConnMessage
packages/realtime_client/src/realtime_client.dart 204:22                          <fn>
dart-sdk/lib/async/zone.dart 1778:9                                               runUnaryGuarded
dart-sdk/lib/async/stream_impl.dart 381:5                                         [_sendData]
dart-sdk/lib/async/stream_impl.dart 312:7                                         [_add]
dart-sdk/lib/async/stream_controller.dart 798:5                                   [_sendData]
dart-sdk/lib/async/stream_controller.dart 663:7                                   [_add]
dart-sdk/lib/async/stream_controller.dart 618:5                                   add
dart-sdk/lib/async/zone.dart 1778:9                                               runUnaryGuarded
dart-sdk/lib/async/stream_impl.dart 381:5                                         [_sendData]
dart-sdk/lib/async/stream_impl.dart 312:7                                         [_add]
dart-sdk/lib/async/stream_controller.dart 798:5                                   [_sendData]
dart-sdk/lib/async/stream_controller.dart 663:7                                   [_add]
dart-sdk/lib/async/stream_controller.dart 618:5                                   add
dart-sdk/lib/async/stream_controller.dart 898:5                                   add
packages/stream_channel/src/guarantee_channel.dart 125:5                          add
packages/web_socket_channel/html.dart 145:23                                      [_innerListen]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 598:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39                 dcall
packages/web/src/helpers/events/streams.dart 165:63                               <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1

However, I get application-breaking casting errors in WebAssembly after deploying to production and I suppose they are of the same origin. I will share more information if I should discover this to be true.

geoextra avatar Apr 04 '25 14:04 geoextra

Same issue for me when running the app on web only.

nirmal-kc avatar Apr 09 '25 04:04 nirmal-kc

Same probleme here :(

joydmaya avatar Apr 16 '25 15:04 joydmaya

Same problem here on web, but only when using hot reload. If I stop and then run the app again, there is no error in console.

reynoldsmjuk avatar Apr 19 '25 02:04 reynoldsmjuk

Same error here Superbase+FlutterFlow

errors.dart:288 Uncaught DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Binding>'
    at Object.throw_ [as throw] (errors.dart:288:3)
    at Object._failedAsCheck (profile.dart:110:39)
    at dart_rti.Rti.new._generalAsCheckImplementation (rti.dart:1383:3)
    at _js_helper.IdentityMap.new._set (identity_hash_map.dart:63:30)
    at realtime_channel.RealtimeChannel.new.off (realtime_channel.dart:433:5)
    at [_cancelRefEvent] (push.dart:120:5)
    at push.Push.new.destroy (push.dart:111:5)
    at realtime_channel.RealtimeChannel.new.unsubscribe (realtime_channel.dart:579:5)
    at realtime_client.RealtimeClient.new.leaveOpenTopic (realtime_client.dart:372:17)
    at realtime_channel.RealtimeChannel.new.rejoin (realtime_channel.dart:633:5)
    at realtime_channel.RealtimeChannel.new.rejoinUntilConnected (realtime_channel.dart:103:7)
    at retry_timer.RetryTimer.new.<anonymous> (realtime_channel.dart:56:26)
    at retry_timer.dart:46:7
    at internalCallback (isolate_helper.dart:47:11)

hamreen avatar May 15 '25 21:05 hamreen

Can we please get this solved, real pain not having real time on web

dennislbc avatar May 26 '25 20:05 dennislbc

Please ensure you are using supabase_flutter v2.9.0 . I couldn't reproduce the issue so if you still see the issue with v2.9.0 please provide an example project and exact steps to reproduce the issue.

Vinzent03 avatar May 27 '25 18:05 Vinzent03

Updating o 2.9.0 fixes

cristiandonaraDEV avatar Jun 06 '25 07:06 cristiandonaraDEV

[!WARNING] I'm still getting this issue in 2.9.0 and 2.9.1 on my Flutter Web App! I think it has to do with one of my realtime listeners? Let me know if you need the code for that.

Here's the stack trace:

DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Binding>'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:3      throw_
errors.dart:266
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39                _generalAsCheckImplementation
profile.dart:117
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 316:9  _set
operations.dart:316
package:realtime_client/src/realtime_channel.dart 446:5                          off
package:realtime_client/src/push.dart 120:5                                      [_cancelRefEvent]
package:realtime_client/src/push.dart 47:5                                       resend
package:realtime_client/src/realtime_channel.dart 648:5                          rejoin
package:realtime_client/src/realtime_channel.dart 103:7                          rejoinUntilConnected
package:realtime_client/src/realtime_channel.dart 56:26                          <fn>
package:realtime_client/src/retry_timer.dart 46:7                                <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 47:11          internalCallback

Here's my Flutter Version:

Flutter 3.32.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d7b523b356 (12 days ago) • 2025-07-15 17:03:46 -0700
Engine • revision 39d6d6e699 (12 days ago) • 2025-07-15 15:39:12 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1

Even hot-reload and hot-restart get infinitely stuck. I have to close my Flutter Web App and start it again. Haven't checked if the issue is on mobile.

adifyr avatar Jul 27 '25 13:07 adifyr

DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Binding>'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:3      throw_
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39                _generalAsCheckImplementation
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 316:9  _set
package:realtime_client/src/realtime_channel.dart 446:5                          off
package:realtime_client/src/push.dart 120:5                                      [_cancelRefEvent]
package:realtime_client/src/push.dart 47:5                                       resend
package:realtime_client/src/realtime_channel.dart 648:5                          rejoin
package:realtime_client/src/realtime_channel.dart 103:7                          rejoinUntilConnected
package:realtime_client/src/realtime_channel.dart 56:26                          <fn>
package:realtime_client/src/retry_timer.dart 46:7                                <fn>
dart-sdk/lib/async/zone.dart 1766:9                                              runGuarded
dart-sdk/lib/async/zone.dart 1814:23                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 47:11          internalCallback

I am also getting the same error in Flutter web and it is continuously throwing this error in logs (but the webapp works without crashing, just that same error is thrown again-and-again). It seems I am using 2.9.0 of supabase_flutter at the moment. Would appreciate any help

  supabase:
    dependency: transitive
    description:
      name: supabase
      sha256: f00172f5f0b2148ea1c573f52862d50cacb6f353f579f741fa35e51704845958
      url: "https://pub.dev"
    source: hosted
    version: "2.7.0"
  supabase_flutter:
    dependency: "direct main"
    description:
      name: supabase_flutter
      sha256: d88eccf9e46e57129725a08e72a3109b6f780921fdc27fe3d7669a11ae80906b
      url: "https://pub.dev"
    source: hosted
    version: "2.9.0"
Flutter 3.32.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision be698c48a6 (3 months ago) • 2025-05-19 12:59:14 -0700
Engine • revision 1881800949 (3 months ago) • 2025-05-19 10:54:07 -0700
Tools • Dart 3.8.0 • DevTools 2.45.1

YashMakan avatar Aug 05 '25 12:08 YashMakan

This issue still persists in 2.10.3. It doesn't crash or affect my client in any way (atleast from what I've observed), but it clogs the console up. I can't seem to find a workaround in my code either, because it appears to fire within the supabase_flutter library after attempting to reconnect to the websocket (I'm assuming).

DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Binding>'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 274:3      throw_
errors.dart:274
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 118:39                _generalAsCheckImplementation
profile.dart:118
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 317:9  _set
operations.dart:317
package:realtime_client/src/realtime_channel.dart 475:5                          off
realtime_channel.dart:475
package:realtime_client/src/push.dart 120:5                                      [_cancelRefEvent]
push.dart:120
package:realtime_client/src/push.dart 47:5                                       resend
push.dart:47
package:realtime_client/src/realtime_channel.dart 677:5                          rejoin
realtime_channel.dart:677
package:realtime_client/src/realtime_channel.dart 103:7                          rejoinUntilConnected
realtime_channel.dart:103
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 274:3      throw_
errors.dart:274
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 118:39                _generalAsCheckImplementation
profile.dart:118
package:realtime_client/src/realtime_channel.dart 56:26                          <fn>
realtime_channel.dart:56
package:realtime_client/src/retry_timer.dart 46:7                                <fn>
retry_timer.dart:46
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 47:11          internalCallback
isolate_helper.dart:47
DartError: TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<Binding>'
environment:
  sdk: ^3.7.0-267.0.dev


dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.8
  intl: ^0.19.0
  logger: ^2.5.0
  provider: ^6.1.5
  supabase_flutter: ^2.10.3
  supabase_auth_ui: ^0.5.5
  go_router: ^16.0.0
  dio: ^5.9.0
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel main, 3.33.0-1.0.pre.54, on Microsoft Windows [Version 10.0.19045.6466], locale de-DE)
[√] Windows Version (10 Pro 64-Bit, 22H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc5)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.3)
[√] Connected device (3 available)
[√] Network resources

potaetus avatar Nov 29 '25 17:11 potaetus