react-select icon indicating copy to clipboard operation
react-select copied to clipboard

JSX namespace not defined, coming from old version of @emotion/react dependency

Open martinnaj opened this issue 7 months ago • 4 comments

Thanks for using react-select!

If you are going to ask a question or want to propose a change or a new feature, then please don't file an issue for this. Questions and feature requests have their own place in our discussions section.

Are you reporting a bug or runtime error?

Compile time issue, latest TS, react, @types/react Please include a test case that demonstrates the issue you're reporting! Importing This is very helpful to maintainers in order to help us see the issue you're seeing.

Please note we are currently only directing our efforts towards the current major (v5) version and beyond.

We understand this might be inconvenient but it is in the best interest of supporting the broader community and to sustain the react-select project going forward.

To report bugs against react-select v5 please fork the following code-sandbox: https://codesandbox.io/s/react-select-v5-sandbox-y5jtm

You may also find the online Babel tool quite helpful if you wish to use ES6/ES7 syntax not yet supported by the browser you are using.

martinnaj avatar Jul 05 '25 22:07 martinnaj

Updating the @emotion/react package should resolve the issue, they are using the JSX namespace, but not including the correct config for it in tsconfig, causing build issues

martinnaj avatar Jul 05 '25 22:07 martinnaj

../../../common/temp/sdk/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/declarations/types/helper.d.ts(8,19): error TS2503: Cannot find namespace 'JSX'. ../../../common/temp/sdk/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/declarations/types/helper.d.ts(9,5): error TS2503: Cannot find namespace 'JSX'. ../../../common/temp/sdk/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/declarations/types/helper.d.ts(9,58): error TS2344: Type 'C' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor'.

martinnaj avatar Aug 25 '25 07:08 martinnaj

We need to upgrade @emotion/react to latest (tried when preferredVersions worked in our monorepo, no longer works due to rush not allowing it with multiple subspaces)

martinnaj avatar Aug 25 '25 07:08 martinnaj

Fixed in #6044

martinnaj avatar Aug 25 '25 07:08 martinnaj