I get the following error when I run an empty flutter app for web.
Command run:
flutter run -d chrome
Error:
Unable to connect to Chrome debug port: 50848
SocketException: Connection refused (OS Error: Connection refused, errno = 61), address = localhost, port = 50849
I tried from different flutter channels (stable, and main). Re-installed Chrome. Nothing works.
Excerpt of Flutter doctor.
[✓] Flutter (Channel main, 3.21.0-9.0.pre.26, on macOS 12.7.2 21G1974 darwin-x64, locale en-MA)
• Flutter version 3.21.0-9.0.pre.26 on channel main at /Users/xyz/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e7baebdce7 (2 hours ago), 2024-03-16 08:56:23 -0400
• Engine revision e4602aa149
• Dart version 3.4.0 (build 3.4.0-240.0.dev)
• DevTools version 2.33.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
2
Answers
What worked for me was modifying
/private/etc/hosts
.Now it looks like:
You can try to specify the port like the following