Skip to content

Playwright cannot connect to localhost, must use 0.0.0.0 #325

Description

@magent-cryptograss

When using Playwright MCP tools to navigate to the dev server, localhost:4000 results in net::ERR_CONNECTION_REFUSED but 0.0.0.0:4000 works.

This is likely a Docker networking or binding issue - the dev server binds to 0.0.0.0 but localhost resolution inside the container may not route correctly.

Workaround: Use 0.0.0.0:4000 instead of localhost:4000 for Playwright navigation.

To investigate:

  • Check webpack-dev-server host binding configuration
  • Verify /etc/hosts or DNS resolution inside container
  • May be related to IPv4 vs IPv6 localhost resolution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions