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

Flutter build web failing due to EventStreamProviders #318

Open
rnp0728 opened this issue Jan 5, 2024 · 6 comments
Open

Flutter build web failing due to EventStreamProviders #318

rnp0728 opened this issue Jan 5, 2024 · 6 comments

Comments

@rnp0728
Copy link

rnp0728 commented Jan 5, 2024

(editor update: see below - we've reverted the 2.4.2 publish of this package).


While running flutter build web the following error comes up, until yesterday the builds are working properly.
The new update on web_socket_channel:2.4.2 affected this error. We are not using this package directly but some of the packages are dependent on it.

ERROR LOGS :

../../../../.pub-cache/hosted/pub.dev/web_socket_channel-2.4.2/lib/src/web_helpers.dart:10:32:
Error: The getter 'EventStreamProviders' isn't defined for the class 'WebSocket'.
 - 'WebSocket' is from 'package:web/src/dom/websockets.dart' ('../../../../.pub-cache/hosted/pub.dev/web-0.3.0/lib/src/dom/websockets.dart').
  Stream<Event> get onOpenX => EventStreamProviders.openEvent.forTarget(this);
                               ^^^^^^^^^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/web_socket_channel-2.4.2/lib/src/web_helpers.dart:12:7:
Error: The getter 'EventStreamProviders' isn't defined for the class 'WebSocket'.
 - 'WebSocket' is from 'package:web/src/dom/websockets.dart' ('../../../../.pub-cache/hosted/pub.dev/web-0.3.0/lib/src/dom/websockets.dart').
      EventStreamProviders.messageEvent.forTarget(this);
      ^^^^^^^^^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/web_socket_channel-2.4.2/lib/src/web_helpers.dart:14:7:
Error: The getter 'EventStreamProviders' isn't defined for the class 'WebSocket'.
 - 'WebSocket' is from 'package:web/src/dom/websockets.dart' ('../../../../.pub-cache/hosted/pub.dev/web-0.3.0/lib/src/dom/websockets.dart').
      EventStreamProviders.closeEvent.forTarget(this);
      ^^^^^^^^^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/web_socket_channel-2.4.2/lib/src/web_helpers.dart:16:7:
Error: The getter 'EventStreamProviders' isn't defined for the class 'WebSocket'.
 - 'WebSocket' is from 'package:web/src/dom/websockets.dart' ('../../../../.pub-cache/hosted/pub.dev/web-0.3.0/lib/src/dom/websockets.dart').
      EventStreamProviders.errorEventSourceEvent.forTarget(this);
      ^^^^^^^^^^^^^^^^^^^^
@rnp0728 rnp0728 changed the title Flutter build web failing due to new update Flutter build web failing due to EventStreamProviders Jan 5, 2024
@crimsonsuv
Copy link

Same here

@ambitencourt
Copy link

Palliative solution:
dependency_overrides:
web_socket_channel: 2.4.0

#316

@GabrielCairesDev
Copy link

Palliative solution: dependency_overrides: web_socket_channel: 2.4.0

#316

Good!

@devoncarew
Copy link
Member

Hi - these most recent issues were likely caused by the release of 2.4.2, which adjusted the dep on package:web in ways that weren't compatible. We're retracted that release - people who have it pinned explicitly will still see it, but it won't be visible to new version solves.

Also, it looks porting this package to use package:web was (unintentionally) a breaking API change - some of the API types exposed from the package are different. We'll track work to address that in a separate issue, but we may revert the 2.4.x range of this package back to using dart:html, and publishing a new 3.0.0 version of this package that's based on package:web.

@NotTsunami
Copy link
Contributor

#305 becomes relevant again because 2.4.3 is once-again reliant on pkg:web 0.4.0 or higher, and Flutter has 0.3.0 pinned. Flutter still won't be able to use 2.4.3.

@devoncarew
Copy link
Member

This is the same situation for other packages that Flutter pins however. You need to use dependencies that are compatible with the versions that Flutter was built with. For package:web, that's:

  • stable - pinned web to 0.3.0
  • beta - pinned web to 0.4.0
  • main - the pin's been removed; the few uses of package:web were in-lined into the framework

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

6 participants