Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: next.js 15 cookies is async function #836

Closed
2 tasks done
dipakparmar opened this issue Oct 28, 2024 · 4 comments · Fixed by #884
Closed
2 tasks done

bug: next.js 15 cookies is async function #836

dipakparmar opened this issue Oct 28, 2024 · 4 comments · Fixed by #884
Assignees
Labels
feature Cool stuff

Comments

@dipakparmar
Copy link

Describe the bug

The current implementation of client.ts uses cookies as synchronous functions, which is incompatible with Next.js 15 and later. In Next.js 15, the cookies object provides asynchronous methods for accessing and manipulating cookies.

Expected behavior

The client.ts code should be updated to use the asynchronous cookie methods introduced in Next.js 15. This will ensure compatibility with the latest versions of Next.js and prevent errors when accessing or manipulating cookies.

How to reproduce?

  1. Use Logto JS SDK in a Next.js 15 project.
  2. Attempt to access or manipulate cookies using the logto client.
  3. Observe errors related to cookies being accessed synchronously.

Context

  • Self-hosted, Logto version =
    • Container (Docker image)
    • Raw Node.js - 20.x.x

Additional context

I believe the following code snippet from packages/next/server-actions/client.ts needs to be updated:

Next.js 15 cookies API reference: https://nextjs.org/docs/app/api-reference/functions/cookies

@dipakparmar dipakparmar added the bug Something isn't working label Oct 28, 2024
@wangsijie wangsijie added feature Cool stuff and removed bug Something isn't working labels Oct 29, 2024
@wangsijie wangsijie self-assigned this Oct 29, 2024
@l4b4r4b4b4
Copy link

@wangsijie Cheers for picking this up! 🙏

@l4b4r4b4b4
Copy link

any progress on this? 👃 ;)

@alishahlakhani
Copy link

Yess please! any update on this? @wangsijie

@wangsijie
Copy link
Contributor

I'll upgrade this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Cool stuff
Development

Successfully merging a pull request may close this issue.

4 participants