kinde-oss / kinde-auth-nextjs

Kinde NextJS SDK - authentication for server rendered apps
https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/
MIT License
157 stars 24 forks source link

Bug: Dynamic route 'cookies' error #240

Closed kdta91 closed 2 weeks ago

kdta91 commented 2 weeks ago

Prerequisites

Describe the issue

Initialized NextJS15 project and installed Kinde library.

  1. Run npm run dev
  2. Access a dynamic route (ie. /app/chat-history/[id].tsx). Error: cookies was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context at getExpectedRequestStore (file:///home/kris/Dev/ai/admin/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js:48:11) at cookies (webpack-internal:///(rsc)/./node_modules/next/dist/server/request/cookies.js:66:84) at eval (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:15219) at p (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:1747) at Generator.eval (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:3093) at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:2176) at j (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:8211) at a (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:8414) at eval (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/server/index.js:22:8473) at new Promise (<anonymous>)

Library URL

https://github.com/kinde-oss/kinde-auth-react

Library version

2.4.6

Operating system(s)

Ubuntu

Operating system version(s)

PopOS 22.04

Further environment details

Node v22.9.0

Reproducible test case URL

NA (localhost)

Additional information

No response