Merged
Conversation
Update @cognigy/chat-components to 0.70.0 which externalizes react/jsx-runtime to prevent React 19 crashes (ReactCurrentOwner removed in React 19). Add react-dom/client, react/jsx-runtime, and react/jsx-dev-runtime to the ESM build externals so consumers provide their own React subpath modules. This enables React 19 consumers (e.g. Interaction Panel MFE via Module Federation) to load the ESM bundle without crashes from bundled React 18 internals. UMD build (webchat.js) is unaffected — it continues to bundle everything inline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds React 19 compatibility for the ESM bundle (dist/webchat.esm.js) by ensuring React runtime subpath imports are not bundled, aligning the embed build output with how consumers provide React.
Changes:
- Externalize
react-dom/client,react/jsx-runtime, andreact/jsx-dev-runtimeinwebpack.es.js(in addition toreact/react-dom). - Bump
@cognigy/chat-componentsto0.70.0. - Update
package-lock.jsonto reflect the dependency bump.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| webpack.es.js | Adds React subpath externals so the ESM build doesn’t inline React 18 runtime modules that break under React 19. |
| package.json | Updates @cognigy/chat-components to a React-19-safe version and tidies devDependency ordering. |
| package-lock.json | Locks @cognigy/chat-components@0.70.0 and its updated transitive dependency graph. |
sushmi21
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@cognigy/chat-componentsto 0.70.0 (externalizesreact/jsx-runtimeto prevent React 19 crashes)react-dom/client,react/jsx-runtime, andreact/jsx-dev-runtimeto ESM build externals inwebpack.es.jsProblem
The ESM build (
webchat.esm.js) bundled React 18's jsx-runtime and react-dom/client inline. When React 19 consumers loaded the ESM bundle, it crashed because:React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner— removed in React 19createRootfrom the externalreact-domroot export, but React 19 only exposes it onreact-dom/clientSolution
Externalize all React subpath imports in the ESM build so consumers provide their own:
The UMD build (
webchat.js) is unaffected — it continues to bundle everything inline for standalone usage.Consumer impact
react/react-domdependenciesreact/jsx-runtimeandreact-dom/clientto thesharedconfigQuick test
After building (
npm run build:esm), save this file asdist/test.htmland serve:python3 -m http.server 8787 -d dist # open http://localhost:8787/test.htmldist/test.html— single-file React 19 ESM testTo test with React 18 instead, change all
@19→@18in the import map.Test plan
ReactCurrentOwnercrash, nocreateRooterror)webchat.esm.jshas 0 references to__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIREDwebchat.esm.jsimportsreact/jsx-runtimeandreact-dom/clientas externals