Throw this error when use react-select library even with npm or esm.sh
Invalid type passed to createElement(): [object Object]
Error: Invalid type passed to createElement(): [object Object]
at a.__b (https://esm.sh/stable/preact@10.19.6/denonext/debug.js:23:9)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:2611)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:2543)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:2543)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
at m (https://esm.sh/v135/preact-render-to-string@6.3.1/X-ZS8q/denonext/preact-render-to-string
And this is the LSP Diagnostic error message
'Select' cannot be used as a JSX component.
Its type 'StateManagedSelect' is not a valid JSX element type.
Type 'StateManagedSelect' is not assignable to type 'FunctionComponent<any>'.
Call signature return types 'ReactElement<any, string | JSXElementConstructor<any>>' and 'VNode<any> | null' are incompatible.
The types of 'type' are incompatible between these types.
Type 'string | JSXElementConstructor<any>' is not assignable to type 'string | ComponentType<any>'.
Type '(props: any, deprecatedLegacyContext?: any) => ReactNode' is not assignable to type 'string | ComponentType<any>'.
Type '(props: any, deprecatedLegacyContext?: any) => ReactNode' is not assignable to type 'FunctionComponent<any>'.
Type 'ReactNode' is not assignable to type 'VNode<any> | null'.
Type 'undefined' is not assignable to type 'VNode<any> | null'.
Throw this error when use
react-select
library even withnpm
oresm.sh
And this is the
LSP Diagnostic
error message