microsoft / microsoft/BotFramework-WebChat

Directline webchat not working in React Strict Mode

Open
#5,127 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bot Services bug customer-reported
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Is it an issue related to Adaptive Cards?

No

Is this an accessibility issue?

No

What version of Web Chat are you using?

Latest production

Which distribution are you using Web Chat from?

NPM

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

Browser: Edge (latest), Browser: Chrome (latest), Browser: Firefox (latest)

Which area does this issue affect?

Others or unrelated

What is the public URL for the website?

No response

Please describe the bug

Minimizable web chat example from samples is not working in React Strict Mode.
conversations API is getting cancelled

React Version: 18.2.0
NodeJS: 18.19.1

Do you see any errors in console log?

No response

How to reproduce the issue?
  1. Navigate to samples of webchat from this repo
  2. Go to minimizable-webchat sample
  3. Add React Strict Mode
  4. Install the node modules and start the application
  5. You will see conversations API getting cancelled.
What do you expect?

Bot should start and conversations API should succeed.

NOTE: Bot works if React Strict Mode is removed.

What actually happened?

Bot shows "connecting..." and not starting. (Attached screenshot for the same)

Do you have any screenshots or recordings to repro the issue?

320514840-b686f10f-a35b-461b-8928-d73a141c7363

Adaptive Card JSON

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the samples/minimizable-webchat sample and reproduce the issue after enabling React Strict Mode with React 18.2.0 and Node.js 18.19.1. Trace why the conversations API is cancelled during startup; done means the bot starts and the conversations API succeeds in the sample while Strict Mode remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.