DartAngular app not building after [SEVERE] Asynchronous error

Issue

Upgraded to dart sdk 2.5.0-stable. After running pub global run webdev serve web:8081 --auto=refresh --release im getting a severe error. I know breaking changes were introduced in this version but after reading changelog still has no idea how to fix it.

[INFO] Building new asset graph completed, took 2.3s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] Serving `web` on http://127.0.0.1:8081
[SEVERE] ERROR - 2019-09-12 09:19:11.608930
[SEVERE] Asynchronous error
[SEVERE] type '_WebSocketProtocolTransformer' is not a subtype of type 'StreamTransformer<Uint8List, dynamic>' of 'streamTransformer'
[SEVERE] dart:async                                                       Stream.transform
[SEVERE] package:web_socket_channel/src/copy/web_socket_impl.dart 712:28  new WebSocketImpl.fromSocket
[SEVERE] package:web_socket_channel/src/channel.dart 94:36                new WebSocketChannel
[SEVERE] package:shelf_web_socket/src/web_socket_handler.dart 82:15       WebSocketHandler.handle.<fn>
[SEVERE] 

Solution

SOLVED. The issue was with build_runner and web_socket_channel. Probably older version got stuck in. After making sure both has the latest version issue was resolved.

web_socket_channel 1.0.15

build_runner: ^1.6.9

Answered By – Máté Horváth

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.