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

Error when using SockJS #325

Open
xbassols opened this issue Dec 18, 2018 · 0 comments
Open

Error when using SockJS #325

xbassols opened this issue Dec 18, 2018 · 0 comments

Comments

@xbassols
Copy link

Hello!
I'm encountering an error that seems to be related to the library when trying to connect to a WS using SockJS like that:
var transportPlatform = new BrowserTransportPlatformWithSockJS( sockJSNoCredentials: true, sockJSDebug: true, sockJSProtocolsWhitelist: ['xhr-streaming', 'websocket'], sockJSTimeout: const Duration(seconds: 10));

await transport.WebSocket.connect(Uri.parse(url), transportPlatform: transportPlatform)

Error:
E/flutter (24053): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception: E/flutter (24053): 'package:w_transport/src/web_socket/browser/sockjs.dart': error: line 37 pos 12: /flutter/.pub-cache/hosted/pub.dartlang.org/w_transport-3.2.8/lib/src/web_socket/browser/sockjs.dart:37:12: Error: Getter not found: 'context'. E/flutter (24053): if (js.context.hasProperty('SockJS')) { E/flutter (24053): ^^^^^^^ E/flutter (24053): if (js.context.hasProperty('SockJS')) { E/flutter (24053): ^ E/flutter (24053): E/flutter (24053): #0 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6) E/flutter (24053): #1 SockJSWebSocket.connect (package:w_transport/src/web_socket/browser/sockjs.dart:28:35) E/flutter (24053): #2 BrowserTransportPlatformWithSockJS.newWebSocket (package:w_transport/src/browser_transport_platform_with_sockjs.dart:76:28) E/flutter (24053): #3 WebSocket.connect (package:w_transport/src/web_socket/web_socket.dart:128:32)

Any ideas on what could it be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant