next-auth-typescript-example
next-auth-typescript-example copied to clipboard
Fixing TS error on property 'session'
Actually, this configuration throws an error on Next.js 12.3.1^ /w Typescript support:
Type error: Property 'session' does not exist on type '{}'
Since release of Next.js v12.3.0, https://github.com/vercel/next.js/releases#:%7E:text=Compare-,v12.3.0,-Latest the interface AppProps takes a generic for pageProps as shown in the details of this merged PR (https://github.com/vercel/next.js/pull/38867)
Importing the Session type and passing it to the AppProps generic fixes this issue.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| next-auth-typescript-example | ❌ Failed (Inspect) | Oct 14, 2022 at 3:48PM (UTC) |