Search code examples
node.jstypescriptnext.jsvercelnext-auth

Error deploy NextJS14 app toVercel - Unexpected token < in JSON at position 0


Here is the problem: image 1

next: 14.1.4
next-auth: 4.24.7
node version: 20

my structure auth folder: image 2

i got no error when run with npm run dev

i've research for this problem for three days, but i still stuck in it. All i know that the problem cause by next-auth... but don't know how to resolve. i just want deploy this for my Graduation Project. Thank you for seeing this


Solution

  • i've resolved this problem by add

    export const runtime = 'edge';
    

    to my page.tsx or remove <Suspense> component