You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the left are the new types from NextJS and on the Right are the types that getToken are using. When upgrading NextJS passed 12.2.0 the types become incompatible.
This is the type of error when upgrading to NextJS v12.2.5
I believe the fix would be upgrading the nextJS package and making sure the types are updated. I'm more than happy to help out with this if I can be pointed in the right direction for how to get started :)
How to reproduce 鈽曪笍
import{getToken}from'next-auth/jwt';import{NextResponse,NextRequest}from'next/server';exportconstmiddleware=async(req: NextRequest)=>{consttoken=awaitgetToken({
req,// Type error heresecret: process.env.JWT_SECRET,secureCookie: secureCookie(),});
...
returnNextResponse.next();};
Contributing 馃檶馃徑
Yes, I am willing to help answer this question in a PR
The text was updated successfully, but these errors were encountered:
I believe bumping next to 12.2.5 in devDependencies should fix it. Feels a bit weird that a devDependencies causes this, so in addition, I think we need same version of next in peerDependencies too 馃
PR welcomes!
Question 馃挰
On the left are the new types from NextJS and on the Right are the types that
getToken
are using. When upgrading NextJS passed 12.2.0 the types become incompatible.This is the type of error when upgrading to NextJS v12.2.5
I believe the fix would be upgrading the nextJS package and making sure the types are updated. I'm more than happy to help out with this if I can be pointed in the right direction for how to get started :)
How to reproduce 鈽曪笍
Contributing 馃檶馃徑
Yes, I am willing to help answer this question in a PR
The text was updated successfully, but these errors were encountered: