skip to Main Content

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


  1. Chosen as BEST ANSWER

    What worked for me was modifying /private/etc/hosts.

    Now it looks like:

    127.0.0.1   localhost
    255.255.255.255 broadcasthost
    ::1             localhost
    

  2. You can try to specify the port like the following

    flutter run -d chrome --web-port 8080
    //Or
    flutter run -d web-server --web-port 8080
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search