W
Wasp2mo ago
lram

Typescript error: Namespace 'React' has no exported member 'JSX'.

I'm on 0.18.1 and I get this typescript error to do with client/router/Link.tsx file Console: [ Wasp ] client/router/Link.tsx(16,10): error TS2694: Namespace 'React' has no exported member 'JSX'. File: export function Link( { to, params, search, hash, ...restOfProps }: Omit<RouterLinkProps, "to"> & { search?: Record<string, string>; hash?: string; } & Routes ): React.JSX.Element { const toPropWithParams = useMemo(() => { return interpolatePath(to, params, search, hash) }, [to, params]) return <RouterLink to={toPropWithParams} {...restOfProps} /> }
1 Reply
kapa.ai
kapa.ai2mo ago
Hi @lram. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message Namespace 'React' has no exported member 'JSX' typically indicates a mismatch between your TypeScript version and the React type definitions being used. The use of React.JSX.Element is only supported in TypeScript 4.1 and above, and with the newer JSX transform introduced in React 17+. However, based on the knowledge sources provided, there is no explicit mention of this specific error or its resolution in the context of Wasp 0.18.1. The closest related issues discuss other TypeScript and React compatibility problems, but not this exact one. Given this, I cannot provide a Wasp-specific solution from the knowledge sources. I recommend checking that your project's TypeScript version is compatible with your React version and the JSX transform being used. If you continue to encounter this issue, consider reaching out on the Wasp Discord or GitHub for more targeted support, as this specific error is not documented in the provided sources. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @lram, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?

Did you find this page helpful?