From b81c628c23e2074be16cdc5e9b36f6beaf6a5ea5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 15 May 2024 17:36:02 -0700 Subject: [PATCH] fix: Externalize JSX runtime (#655) The JSX runtime is currently being bundled which is generally not supported. The JSX runtime needs to be in lockstep with the React version. This currently breaks in React 19 because the bundled JSX runtime tries to access secret internals that have been moved. --- core/.kktrc.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/.kktrc.ts b/core/.kktrc.ts index 3fefa0020..961cc465a 100644 --- a/core/.kktrc.ts +++ b/core/.kktrc.ts @@ -65,6 +65,18 @@ export default (conf: WebpackConfiguration, env: 'production' | 'development', o commonjs: 'react-dom', amd: 'react-dom', }, + 'react/jsx-runtime': { + root: 'ReactJSXRuntime', + commonjs2: 'react/jsx-runtime', + commonjs: 'react/jsx-runtime', + amd: 'react/jsx-runtime', + }, + 'react/jsx-dev-runtime': { + root: 'ReactJSXDevRuntime', + commonjs2: 'react/jsx-dev-runtime', + commonjs: 'react/jsx-dev-runtime', + amd: 'react/jsx-dev-runtime', + }, }; } return conf;