Next Auth problem in Vercel

I'm currently deploying my app in Vercel but it won't work because of the following error:

TypeError: "ikm"" must be an instance of Uint8Array or a string
    at (node_modules/@panva/hkdf/dist/web/index.js:17:0)
    at (node_modules/@panva/hkdf/dist/web/index.js:21:0)
    at (node_modules/@panva/hkdf/dist/web/index.js:44:17)
    at (node_modules/next-auth/jwt/index.js:114:0)
    at (node_modules/next-auth/jwt/index.js:61:0)
    at (src/middleware.ts:23:28)
    at (node_modules/next/dist/esm/server/web/adapter.js:97:0)
    at ([native code])


This is the block of code in middleware.ts that the stack trace refers to:

  const user = await decode({
    token: token.value,
    secret: process.env.NEXTAUTH_SECRET!,
  });


Googling it looks like NEXTAUTH_SECRET is not set up in Vercel, but it is (as the image shows).

Tips?
image.png
Was this page helpful?