nextjs-strapi-boilerplate
nextjs-strapi-boilerplate copied to clipboard
message: "Cannot read property 'id' of undefined", :(
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] https://next-auth.js.org/errors#oauth_callback_handler_error Cannot read property 'id' of undefined { message: "Cannot read property 'id' of undefined", stack: "TypeError: Cannot read property 'id' of undefined\n" + ' at Object.jwt (webpack-internal:///(api)/./pages/api/auth/[...nextauth].ts:43:38)\n' + ' at processTicksAndRejections (internal/process/task_queues.js:95:5)\n' + ' at async Object.callback (D:\next.js strapi v3\frontend\node_modules\next-auth\core\routes\callback.js:133:25)\n' + ' at async NextAuthHandler (D:\next.js strapi v3\frontend\node_modules\next-auth\core\index.js:139:28)\n' + ' at async NextAuthNextHandler (D:\next.js strapi v3\frontend\node_modules\next-auth\next\index.js:21:19)\n' + ' at async Object.apiResolver (D:\next.js strapi v3\frontend\node_modules\next\dist\server\api-utils\node.js:184:9)\n' + ' at async DevServer.runApi (D:\next.js strapi v3\frontend\node_modules\next\dist\server\next-server.js:397:9)\n' + ' at async Object.fn (D:\next.js strapi v3\frontend\node_modules\next\dist\server\base-server.js:473:37)\n' + ' at async Router.execute (D:\next.js strapi v3\frontend\node_modules\next\dist\server\router.js:233:32)\n' + ' at async DevServer.run (D:\next.js strapi v3\frontend\node_modules\next\dist\server\base-server.js:583:29)', name: 'TypeError' }
Enabling Google (any provider you enabled for NextAuth) under Strapi solves this issue. Configure Strapi