-
SummaryHi everyone, I have a layout that makes use of the Parallel Routes feature. Type error: Layout "app/archives/layout.tsx" has an invalid "default" export:
Type "Props" is not valid. This is how the layout is setup, any ideas on what might be causing this? type Props = {
children: React.ReactNode
archivePanel: React.ReactNode
archiveForm: React.ReactNode
}
export default function Layout({
children,
archivePanel,
archiveForm
}: Props) {
return (
<>
{children}
{archivePanel}
{archiveForm}
</>
)
} Any thoughts would be really helpful 🙏 Additional informationApp is using Next `14.0.1`.
This snippet uses parallel routes: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes
The error is thrown at `next build`:
Type error: Layout "app/archives/layout.tsx" has an invalid "default" export:
Type "Props" is not valid. Example |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
I guess the issue is, type Props = {
children: React.ReactNode
archive: React.ReactNode // This one looks wrong? should it `archivePanel`?
archiveForm: React.ReactNode
} Or maybe the other way around, the |
Beta Was this translation helpful? Give feedback.
-
For anyone still facing this issue: Build error only comes up if you have declared the page inside props but the file doesn't exist inside the folder layout. |
Beta Was this translation helpful? Give feedback.
-
I had the same issue and came across this post. I found out that: Now I increased the version to typescript "latest" @ |
Beta Was this translation helpful? Give feedback.
This is a really stupid way to solve this, you can't even ts ignore the entire file but if it has the default expected type it passes build, so this works: