Skip to content

Instantly share code, notes, and snippets.

@stephenway
Created August 11, 2019 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenway/41b5e7f622a06d8f3fd0d7ae4ecb4002 to your computer and use it in GitHub Desktop.
Save stephenway/41b5e7f622a06d8f3fd0d7ae4ecb4002 to your computer and use it in GitHub Desktop.
Next.js + Typescript Main App Class Errors
Class static side 'typeof MyApp' incorrectly extends base class static side 'typeof App'.
Types of property 'getInitialProps' are incompatible.
Type '({ Component, ctx }: any) => Promise<{ pageProps: {}; locale?: undefined; messages?: undefined; initialNow?: undefined; } | { query: any; authtoken: string; isLoggedIn: boolean; locale: any; messages: any; initialNow: number; pageProps?: undefined; } | { ...; }>' is not assignable to type '(context: NextAppContext<Record<string, string | string[] | undefined>, {}>) => Promise<DefaultAppIProps>'.
Type 'Promise<{ pageProps: {}; locale?: undefined; messages?: undefined; initialNow?: undefined; } | { query: any; authtoken: string; isLoggedIn: boolean; locale: any; messages: any; initialNow: number; pageProps?: undefined; } | { ...; }>' is not assignable to type 'Promise<DefaultAppIProps>'.
Type '{ pageProps: {}; locale?: undefined; messages?: undefined; initialNow?: undefined; } | { query: any; authtoken: string; isLoggedIn: boolean; locale: any; messages: any; initialNow: number; pageProps?: undefined; } | { ...; }' is not assignable to type 'DefaultAppIProps'.
Type '{ query: any; authtoken: string; isLoggedIn: boolean; locale: any; messages: any; initialNow: number; pageProps?: undefined; }' is not assignable to type 'DefaultAppIProps'.
Property 'pageProps' is optional in type '{ query: any; authtoken: string; isLoggedIn: boolean; locale: any; messages: any; initialNow: number; pageProps?: undefined; }' but required in type 'DefaultAppIProps'.ts(2417)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment