Typescript type issue: Server Component cannot be used as a JSX component. "Its return type 'Promise<Element>' is not a valid JSX component #43537
Labels
bug
Issue was opened via the bug report template.
TypeScript
Related to types with Next.js.
Upstream
Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Builds fail whenever I introduce a Server Component into any page within the
app
directory. Whilst running the development server, the component works fine.As of my understanding the following should be possible:
app/page.tsx
components/User.tsx
But instead, I'm receiving the following error in my editor and during local build:
Expected Behavior
The build shouldn't fail
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/jordykoppen/nextjs-13-server-component-issue
To Reproduce
The build step should fail with the same error as above.
The text was updated successfully, but these errors were encountered: