Flutter build web fails with The compiler crashed: WebSocketException: Connection to 'https:<ip>/ws#' was not upgraded to websocket

Viewed 24

Able to build for IOS, Android and Web without any problem locally but when I try to build on another device I get this error below. Not sure exactly what the issue is as its just saying the compiler crashed trying to connect to a random address.

Using Flutter 3.3

Build Output

$ flutter build web -t lib/flavors/local-ui/main-local-ui.dart --release
Downloading Web SDK...                                          
    3.2s
Downloading CanvasKit...                                        
   639ms
 Building with sound null safety 
Compiling lib/flavors/local-ui/main-local-ui.dart for the Web...     
Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
/root/.pub-cache/hosted/pub.dartlang.org/feature_flags-0.1.4/lib/src/features.dart:74:20:
Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/sdks/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
                   ^
/root/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.12.0/lib/src/chart_container.dart:205:27:
Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/sdks/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    if (!SchedulerBinding.instance!.hasScheduledFrame) {
                          ^
/root/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.12.0/lib/src/chart_container.dart:206:24:
Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/sdks/flutter/packages/flutter/lib/src/scheduler/binding.dart').
      SchedulerBinding.instance!.scheduleFrame();
                       ^
/root/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.12.0/lib/src/chart_container.dart:209:22:
Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/sdks/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback(startAnimationController);
                     ^
/root/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.12.0/lib/src/chart_container.dart:232:22:
Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/sdks/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback(doRebuild);
                     ^
The compiler crashed: WebSocketException: Connection to 'http://127.0.0.1:44625/MQWvf4Pue0Q=/ws#' was not upgraded to websocket
#0      _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1011:41)
#1      WebSocket.connect (dart:_http/websocket.dart:320:22)
#2      vmServiceConnectUri (package:vm_service/vm_service_io.dart:32:44)
#3      _currentHeapCapacity (package:compiler/src/common/ram_usage.dart:27:41)
<asynchronous suspension>
#4      currentHeapCapacityInMb (package:compiler/src/common/ram_usage.dart:38:20)
<asynchronous suspension>
#5      compile.compilationDone (package:compiler/src/dart2js.dart:1066:12)
<asynchronous suspension>
#6      main (package:compiler/src/dart2js.dart:1424:3)
<asynchronous suspension>
Compiling lib/flavors/local-ui/main-local-ui.dart for the Web...        23.1s
Exception: Failed to compile application for the Web.
0 Answers
Related