-
Notifications
You must be signed in to change notification settings - Fork 67
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
Hub handshake failed with error 'NoSuchMethodError: The method 'send' was called on null. #16
Comments
I think you should pass one of
Did you try this? signalr_core/lib/src/http_connection_options.dart Lines 19 to 20 in 9cfeea4
|
I don't love this option being dynamic, It was done to keep consistent with the ASP SignalR typescript client. I think it could be used for custom transports... I don't believe this parameter is supposed to receive a list though. |
Any solution yet? |
Only a single transport can be specified, it can be an |
I am trying to connect to server. But I am getting - Hub handshake failed with error 'NoSuchMethodError: The method 'send' was called on null.
Below is the Console log -
I/flutter (22642): log The HttpConnection connected successfully.
I/flutter (22642): log Sending handshake request.
I/flutter (22642): log Hub handshake failed with error 'NoSuchMethodError: The method 'send' was called on null.
I/flutter (22642): Receiver: null
I/flutter (22642): Tried calling: send("{"protocol":"json","version":1}\u001e")' during start(). Stopping HubConnection.
I/flutter (22642): log HubConnection failed to start successfully because of error '{type 'NoSuchMethodError' is not a subtype of type 'Exception'.toString}'.
E/flutter (22642): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type 'NoSuchMethodError' is not a subtype of type 'Exception'
E/flutter (22642): #0 HubConnection._startInternal (package:signalr_core/src/hub_connection.dart:215:41)
E/flutter (22642):
E/flutter (22642): #1 HubConnection._startWithStateTransitions (package:signalr_core/src/hub_connection.dart:151:13)
E/flutter (22642): #2 HubConnection.start (package:signalr_core/src/hub_connection.dart:137:20)
Here is my code snippet -
final connection = HubConnectionBuilder().withUrl(_serverUrl,
HttpConnectionOptions(
transport:[HttpTransportType.webSockets,HttpTransportType.longPolling],
logging: (level, message) => print('log $message'),
)).withAutomaticReconnect().build();
Please help me to figure out this issue.
The text was updated successfully, but these errors were encountered: