iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🚫

Bot Framework WebChat fails to initialize when React StrictMode is enabled

に公開

Bot Framework WebChat is a client library for embedding Microsoft Bot Framework into websites. When using this library with React, you may encounter issues where it fails to initialize, preventing the chat from starting. This issue has been reported.

https://github.com/microsoft/BotFramework-WebChat/issues/4300

Starting with React 18, enabling StrictMode causes rendering to occur twice. This is an intentional behavior designed to detect bugs caused by side effects. However, because Bot Framework WebChat does not currently support this behavior, it leads to errors. The behavior of React StrictMode occurs only during development and will not happen in a production build.

https://ja.react.dev/reference/react/StrictMode#fixing-bugs-found-by-double-rendering-in-development

To circumvent this issue, you need to disable StrictMode.

Discussion