YMH
YMH

Reputation: 3093

Attempting to connect to browser instance.. (Flutter Web)

I'm trying to run my first flutter code on the web. I followed setup instructions provided in Building a web application with Flutter and created a very simple app, that's only supposed to display a navigation bar. Now as I'm running my application for the first time on "Chrome (web)" device, it won't connect to the browser. It's been almost 20 minutes and it's still telling me "Attempting to connect to browser instance".

> flutter run -d chrome

Launching lib\main.dart on Chrome in debug mode...
Building application for the web... 1215.1s
Attempting to connect to browser instance..
(This is taking an unexpectedly long time.)

Can anyone guide me on how to fix this?

Upvotes: 5

Views: 3854

Answers (4)

Yves Boutellier
Yves Boutellier

Reputation: 2024

I experienced the something similar, chrome opens but never showed the web app (just white screen). In my case it had to do with the interaction of flutter and riverpod.

If you are using riverpod 1.0.0 and flutter 2.5.3 you need to update flutter to 2.8.0 or 2.8.1 (see this issue: https://github.com/rrousselGit/river_pod/issues/889)

Upvotes: 0

massive success
massive success

Reputation: 21

It's mostly nothing to do with Flutter but, it's either because you have logged in your computer in safe mode. In my case the shift key was stuck and I had no idea I was in safe mode.

Or else You need to check your firewall, go to System Preferences > Security and Privacy > Firewall --click the lock below and enter your system password -- and then click firewall option -- In there add your editor to allow internet connection for android studio Or VS Code.

Upvotes: 0

Lahiru Jayakody
Lahiru Jayakody

Reputation: 5400

In my case, I couldn't disable the virus guard. So I used the server mode.

flutter run -d web-server

Launching lib\main.dart on Web Server in debug mode...
Building application for the web... 8.8s
lib\main.dart is being served at http://localhost:57598/

Then go to the URL shown.

Upvotes: 4

Dartagnan
Dartagnan

Reputation: 21

The same thing happened to me, I disabled the anti virus and it worked

Upvotes: 2

Related Questions