Next.js Discord

Discord Forum

Error Passing Props in Next.js 15: Type 'OmitWithTag<OverviewPageProps, keyof PageProps, "default">'

Unanswered
Masai Lion posted this in #help-forum
Open in Discord
Masai LionOP
Error Passing Props in Next.js 15: Type 'OmitWithTag<OverviewPageProps, keyof PageProps, "default">' does not satisfy constraint
Hi Next.js Community,
After upgrading to Next.js 15, I encountered an error when trying to pass props to a component. This worked fine in Next.js 14, but now I’m getting the following error:
Type error: Type 'OmitWithTag<OverviewPageProps, keyof PageProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'.
Property 'institutionKey' is incompatible with index signature.
32 |
33 | // Check the prop type of the entry function
34 | checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
| ^
35 |
36 | // Check the arguments and return type of the generateMetadata function
37 | if ('generateMetadata' in entry) {
Static worker exited with code: 1 and signal: null
Steps to Reproduce:
Create a Server Component that passes a prop to a Client Component.
Define a prop interface in the Client Component (e.g., OverviewPageProps).
Pass the prop from the Server Component to the Client Component.
Example Code:
typescript
// Server Component
import OverviewPage from './OverviewPage';
export default function ParentComponent() {
const institutionKey = "3MZWSV85F"; // Example value
return <OverviewPage institutionKey={institutionKey} />;
}
typescript
// Client Component (OverviewPage.tsx)
"use client";
interface OverviewPageProps {
institutionKey: string;
}
export default function OverviewPage({ institutionKey }: OverviewPageProps) {
return (
<div>
<h1>Overview Page</h1>
<p>Institution Key: {institutionKey}</p>
</div>
);
}
Expected Behavior:
The institutionKey prop should be passed to the OverviewPage component without errors.
Actual Behavior:
The above error occurs, and the build fails.
Additional Information:
Next.js version: 15.0.0
Is this a known issue, or am I missing something in the migration guide? Any help would be appreciated!
Thank you,
Enma

0 Replies