Flutter taking an unexpectedly long time for connecting to browser

Try with flutter run -d web-server, then open URL on Chrome manually.


  1. Remove all unused dependencies
  2. flutter run -d web-server

The answer mentioned by @Giampaolo is a great workaround!


Same issue here. When trying the sample project, it works. I think the problem has something to do with dependencies, but have not figured out in detail.

Update: Could be related: https://github.com/flutter/flutter/issues/40876 and https://github.com/flutter/flutter/issues/39998

Update #2: I could reproduce the issue a described in https://github.com/flutter/flutter/issues/39998

1) Create fresh flutter project with web support -> works.

2) add import 'dart:io'; to main.dart -> blank screen

Tags:

Dart

Flutter