Skip to content

[BUG] DevTools opens browser with stale port after quit and relaunch in debug mode #520

@josephemorgan

Description

@josephemorgan

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running a Flutter app with :FlutterRun or :FlutterDebug, DevTools starts correctly (e.g., on port 9100). After quitting with :FlutterQuit and relaunching, DevTools opens the browser with the old port (9100) instead of the new one (e.g., 9101). The page either fails to load or shows stale content.

Expected Behavior

After quitting and relaunching, DevTools should start a fresh server and open the browser with the correct new port.

Steps To Reproduce

  1. Open a Flutter project in Neovim with flutter-tools configured.
  2. Run :FlutterDebug, DevTools starts on port 9100, browser opens correctly
  3. Run :FlutterQuit
  4. Run :FlutterDebug again. After building, the browser window opens, but the page says unable to connect. Manually switching the port in the URL to 9101 connects.

Environment

- OS: Windows 11
- Flutter version: 3.35.7
- Is flutter in $PATH: Yes
- neovim version: 0.11.06

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions