Skip to content

fix(types): AppType getInitialProps should return AppInitialProps - #98334

Open
thedhruvhegde wants to merge 1 commit into
vercel:canaryfrom
thedhruvhegde:fix/app-type-getinitialprops
Open

fix(types): AppType getInitialProps should return AppInitialProps#98334
thedhruvhegde wants to merge 1 commit into
vercel:canaryfrom
thedhruvhegde:fix/app-type-getinitialprops

Conversation

@thedhruvhegde

@thedhruvhegde thedhruvhegde commented Sep 7, 2026

Copy link
Copy Markdown

why

AppType<P>['getInitialProps'] was typed as returning P. Next.js actually requires { pageProps } (AppInitialProps<P>), so a correct _app implementation failed typecheck and a wrong { foo: 'bar' } return typechecked.

what

  • type getInitialProps as AppInitialProps<P>
  • update the typescript e2e _app fixture to return { pageProps }

related #42846

App.getInitialProps is typed as returning P, so returning { pageProps } failed typecheck even though Next.js requires that shape. Align AppType with Next.js runtime and the AppInitialProps contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant