'SomeComponent' cannot be used as a JSX component.
Problem
Verify canary release - [X] I verified that the issue exists in the latest Next.js canary release Provide environment information [code block] What browser are you using? (if relevant) _No response_ How are you deploying your application? (if relevant) _No response_ Describe the Bug Any components are producing IDE error but builds successfully. [code block] Expected Behavior probably not give an error when using async components Link to reproduction no link To Reproduce [code block]
Error Output
error but builds successfully.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: 'SomeComponent' cannot be used as a JSX component.
I think a fix is upcoming, but pretty much the issue is that TypeScript doesn't understand async components... It always expects JSX as child, not `Promise<JSX>`. Many are type casting the component and exporting that type casted version... I think it might be better to do: [code block] When the types are fixed, the `@ts-expect-error` directive will complain that it is unused... This fix migh
Trust Score
9 verifications
- 1
I think a fix is upcoming, but pretty much the issue is that TypeScript doesn't
I think a fix is upcoming, but pretty much the issue is that TypeScript doesn't understand async components... It always expects JSX as child, not `Promise<JSX>`.
- 2
Many are type casting the component and exporting that type casted version... I
Many are type casting the component and exporting that type casted version... I think it might be better to do:
- 3
When the types are fixed, the `@ts-expect-error` directive will complain that it
When the types are fixed, the `@ts-expect-error` directive will complain that it is unused...
- 4
This fix might come from the next typescript plugin I think, not sure.
This fix might come from the next typescript plugin I think, not sure.
Validation
Resolved in vercel/next.js GitHub issue #42292. Community reactions: 141 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep