shamblett / mqtt5_client

A server and browser based MQTT 5 client for dart
Other
51 stars 29 forks source link

pub.dartlang.org/mqtt5_client-3.1.3/lib/mqtt5_browser_client.dart:11:8: Error: Not found: 'dart:html' import 'dart:html'; #20

Closed spich closed 2 years ago

spich commented 2 years ago

I got this on Web version.

lib/mqtt_browser_client.dart: Warning: Interpreting this as package URI, 'package:mojifinal/mqtt_browser_client.dart'. /C:/flutter/.pub-cache/hosted/pub.dartlang.org/mqtt5_client-3.1.3/lib/mqtt5_browser_client.dart:11:8: Error: Not found: 'dart:html' import 'dart:html'; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/mqtt5_client-3.1.3/lib/src/connectionhandling/browser/mqtt_browser_ws_connection.dart:51:16: Error: The method 'WebSocket' isn't defined for the class 'MqttBrowserWsConnection'.

Process finished with exit code 254

shamblett commented 2 years ago

I'm not sure what this means -

Warning: Interpreting this as package URI, 'package:mojifinal/mqtt_browser_client.dart'.

but it looks as though your are trying to use the browser client in a flutter environment, which is a server side dev env so you need the server client. The browser client is for use in flutter web development.