'Flutter: Unable to run app in debug mode in chrome

i wanna run flutter web app on chrome in debug mode but whenever i try so, i get this error

Failed to establish connection with the application instance in Chrome. This can happen if the websocket connection used by the web tooling is unable to correctly establish a connection, for example due to a firewall.

but release mode works properly using

flutter run -d chrome --release

i have tried;

flutter clean.

flutter pub cache repair

switching to master channel

disabling firewalls

But none of these worked. I seriously need to run the app in debug mode for troubleshooting. Thanks in advance



Solution 1:[1]

You have to download Dart Debug Extension on Google Chrome to run flutter app on chrome through your editor

Solution 2:[2]

None of the above worked for me, too. Then, I disconnected my VPN and started debugging. It worked fine.

Solution 3:[3]

This error kept popping up randomly. I would run flutter clean but that only worked for a few runs then the problem came back. I decided to use Edge and so far I haven't seen the problem again.

flutter run -d edge

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Danial Sa'adati
Solution 3 wandesky