sefidgaran / signalr_client

A Flutter SignalR Client for ASP.NET Core
https://pub.dev/packages/signalr_netcore
MIT License
71 stars 112 forks source link

Web support #5

Closed milodude closed 3 years ago

milodude commented 3 years ago

While trying to initiate the connection with the server I'm getting this next error.

Error: Unsupported operation: Platform._version at Object.throw_ [as throw] (http://localhost:54573/dart_sdk.js:5348:11) at Function._version (http://localhost:54573/dart_sdk.js:56583:17) at Function.get version [as version] (http://localhost:54573/dart_sdk.js:56657:27) at get _version (http://localhost:54573/dart_sdk.js:56527:27) at Function.desc.get [as _version] (http://localhost:54573/dart_sdk.js:5853:17) at Function.get version [as version] (http://localhost:54573/dart_sdk.js:56501:26) at Object._getHttpVersion (http://localhost:54573/dart_sdk.js:200676:31) at new _http._HttpClient.new (http://localhost:54573/dart_sdk.js:195641:28) at main.MyHttpOverrides.new.createHttpClient (http://localhost:54573/dart_sdk.js:198667:14) at main.MyHttpOverrides.new.createHttpClient (http://localhost:54573/packages/globalnewswebapp/main.dart.lib.js:203:26) at Function.new (http://localhost:54573/dart_sdk.js:189717:24) at dartio_http_client.DartIOHttpClient.new.<anonymous> (http://localhost:54573/packages/signalr_netcore/json_hub_protocol.dart.lib.js:1914:46) at Generator.next (<anonymous>) at runBody (http://localhost:54573/dart_sdk.js:39250:34) at Object._async [as async] (http://localhost:54573/dart_sdk.js:39281:7) at http://localhost:54573/packages/signalr_netcore/json_hub_protocol.dart.lib.js:1911:71 at http://localhost:54573/dart_sdk.js:33560:31 at internalCallback (http://localhost:54573/dart_sdk.js:25311:11)

How can I fix this? I have been googling this and seems an http issue when developing a web app with flutter only.

sefidgaran commented 3 years ago

This package does not support web yet as you can see in the package information: https://pub.dev/packages/signalr_netcore The problem is, it is using dart:io package internally which does not support web. Hopefully, I will manage to fix this and publish a new version with full web support, while any PR welcomed.

Thanks

sefidgaran commented 3 years ago

Thanks for the PR from @mikeesouth that is going to cover Web as well. @milodude please have a check.

Thanks