Skip to content

[Bug] Emulator can't connect with my backend server on Windows WSL (ECONNRESET) #2483

@tifilipebr

Description

@tifilipebr

Version

Emulator version: 4.15.1

Describe the bug

When connecting to a local bot using the Bot Framework Emulator, the conversation.id includes a |livechat suffix (e.g., b9261fc1-57a1-11f0-8f54-bd61984248b7|livechat), and the serviceUrl is set to http://localhost:60844.

This causes the bot to attempt to POST a response to an unavailable service on port 60844, resulting in the following error:

FetchError: request to http://localhost:60844/v3/conversations/...|livechat/activities/... failed, reason: connect ECONNREFUSED 127.0.0.1:60844

This happens even when there is no explicit fetch to that URL in the bot's code — only standard context.sendActivity() calls via the Bot Framework SDK.

To Reproduce

Steps to reproduce the behavior:

  1. Open Bot Framework Emulator v4.15.1
  2. Connect to a bot running locally (e.g., http://localhost:3978/api/messages)
  3. Observe the bot's onTurnError or middleware log context.activity
  4. Notice that conversation.id contains |livechat and serviceUrl points to http://localhost:60844
  5. Any sendActivity() results in a FetchError due to connection refusal on port 60844

Expected behavior

When running in the Emulator, the conversation.id should not include |livechat, and the serviceUrl should point to the bot's actual listening address (e.g., http://localhost:3978). The Emulator should not simulate an unavailable "livechat" channel by default.

Screenshots

Not applicable for this issue (behavior is observed via logs and thrown errors).

Additional context

  • This behavior causes the bot to fail on the first message, even when running locally.
  • Workarounds include skipping activity handling when conversation.id includes |livechat, or manually overriding the serviceUrl, but this is not ideal for local development.

[bug]

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugYour classic code defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions