New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type error on build – 'Li' cannot be used as a JSX component. #11
Comments
I have the exact same issue, when building a docker image. `Failed to compile. ./node_modules/@portabletext/react/src/react-portable-text.tsx:136:8 |
Solved my error by upgrading "@portabletext/react": "1.0.6", and "react": "18.0.0" but that might not be a solution for everybody. |
Hi I am also having the same issue, suddenly on a new install I get this issue? Additional Info:Node Version: v16.14.2 UPDATE:Interestingly this seems to only happen when I install the package using Yarn, it works fine using |
Yes, worked for me too |
I wonder if the reason this works is because of https://twitter.com/dan_abramov/status/1513871810969882625?cxt=HHwWgsCyhYWZrYIqAAAA |
I had the same error I solved by wrapping the component inside a native html tag. I'm using the pinterest gestalt library, specifically the Link component to render the links of the portable text and i was getting this error so i changed this:
To this, by wrapping the
And it worked. Looks like there is a compatibility issue with react components. Hope it helps. |
Did anyone find a working fix for this other than upgrading to React 18? |
Adding/upgrading |
Looks like this is a solved by an upgrade. |
I started to get this type error during build step on Vercel 24 hours ago. Latest sucessfully build was 3 days ago:
Type error: 'Li' cannot be used as a JSX component.
in @portabletext/reactProject: Next JS, Sanity.
Dependencies I use (the relevant parts):
Error:
The text was updated successfully, but these errors were encountered: