Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DonnyDevIT opened this issue Mar 6, 2025 · 9 comments
Labels
bug Something isn't working realtime This issue or pull request is related to realtime

Comments

@DonnyDevIT
Copy link

DonnyDevIT commented Mar 6, 2025

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();

@DonnyDevIT DonnyDevIT added the bug Something isn't working label Mar 6, 2025
@dshukertjr dshukertjr added the realtime This issue or pull request is related to realtime label Mar 18, 2025
@Vinzent03
Copy link
Collaborator

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.

@DonnyDevIT
Copy link
Author

@Vinzent03 Just run

@Vinzent03
Copy link
Collaborator

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.

@geoextra
Copy link
Contributor

geoextra commented Apr 4, 2025

Related to #1122.

@geoextra
Copy link
Contributor

geoextra commented Apr 4, 2025

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.

@nirmal-kc
Copy link

nirmal-kc commented Apr 9, 2025

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

@joydmaya
Copy link

Same probleme here :(

@reynoldsmjuk
Copy link

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.

@hamreen
Copy link

hamreen commented May 15, 2025

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working realtime This issue or pull request is related to realtime
Projects
None yet
Development

No branches or pull requests

8 participants