Skip to content
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

[Web] [Dev Channel] Hub handshake failed with error 'NoSuchMethodError: #31

Closed
DaveBubenik opened this issue Jan 5, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@DaveBubenik
Copy link

The following messages are logged:

Selecting transport 'HttpTransportType.webSockets'.
(WebSockets transport) Connecting.
The HttpConnection connected successfully.
Sending handshake request.
(WebSockets transport) sending data. String data of length '32'.
Hub handshake failed with error 'NoSuchMethodError: invalid member on null: 'sink'' during start(). Stopping HubConnection.
HubConnection failed to start successfully because of error '{Expected a value of type 'Exception', but got one of type 'JSNoSuchMethodError'.toString}'.
Expected a value of type 'Exception', but got one of type 'JSNoSuchMethodError'

I've tracked this down to an issue with _createConnectUrl in http_connection.dart. The function will generate a string that ends with a "#" if there is no uri.fragment. This can be corrected by doing the following:

return Uri(
      scheme: uri.scheme,
      host: uri.host,
      port: uri.port,
      path: uri.path,
      fragment: uri.fragment.isNotEmpty ? uri.fragment : null,
      queryParameters: <String, dynamic>{
        ...uri.queryParameters,
        ...{'id': connectionToken},
      },
    ).toString();
@jamiewest jamiewest self-assigned this Jan 6, 2021
@jamiewest jamiewest added the bug Something isn't working label Jan 6, 2021
@jamiewest
Copy link
Owner

Thank you for the issue and code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants