I'm encountering a problem when trying to deploy my application. Building it on my local machine works fine, but the build on GitHub is causing issues.
Just so you know, I am using yarn and yarn build for this project.
After doing some research, it seems like the issue might be related to TypeScript, a mistake that I haven't caught yet, or possibly an incorrect configuration in GitHub CI. It's all a bit unclear...
This is a snippet of my code from [...nextauth].ts
import NextAuth, { NextAuthOptions } from "next-auth"
...
// The rest of the code has been omitted for brevity
The specific error message I'm getting is:
Failed to compile.
./src/pages/api/auth/[...nextauth].ts:99:15
Type error: Property 'accessToken' does not exist on type 'Session'.
97 | async session({ session, token }) {
98 | session.user = token.user!,
> 99 | session.accessToken = token.accessToken
| ^
100 | session.error = token.error
101 |
102 | return session
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
EDIT: Based on the feedback I received, it appears that the issue may be related to the version of next auth being used.