braverhealth / phoenix-socket-dart

Cross-platform and stream-based implementation of Phoenix Sockets
https://pub.dev/packages/phoenix_socket
BSD 3-Clause "New" or "Revised" License
74 stars 37 forks source link

flutter example doesn't work #10

Closed ConnorRigby closed 3 years ago

ConnorRigby commented 3 years ago
E/flutter ( 7108): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The getter 'closeReason' was called on null.
E/flutter ( 7108): Receiver: null
E/flutter ( 7108): Tried calling: closeReason
E/flutter ( 7108): #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:51:5)
E/flutter ( 7108): #1      Null.closeReason  (dart:core/null.dart:1:1)
E/flutter ( 7108): #2      PhoenixSocket._onSocketClosed 
package:phoenix_socket/src/socket.dart:511
E/flutter ( 7108): #3      PhoenixSocket._onSocketError 
package:phoenix_socket/src/socket.dart:498
E/flutter ( 7108): #4      PhoenixSocket.connect 
package:phoenix_socket/src/socket.dart:200
E/flutter ( 7108): <asynchronous suspension>
E/flutter ( 7108):
matehat commented 3 years ago

@ConnorRigby do you have the example Phoenix Server running, from the example/backend directory?

matehat commented 3 years ago

I suspect the backend wasn't running, so that was a connection error on socket startup, but it was badly handled. c75c5bf90217340f13cf2615719ebc8bcba57086 fixes that, and the fix were published as part of the 0.4.6 release.