next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

Fetch Cache Error on session's cookies

Open trpipher opened this issue 3 years ago • 7 comments

Question 💬

Since Next 13.2 I've been getting this error Failed to set fetch cache http://localhost:3000/api/auth/session TypeError: cookies is not iterable

How to reproduce ☕️

here is my minimum repo You see the error in the server terminal on page load

Contributing 🙌🏽

No, I am afraid I cannot help regarding this

trpipher avatar Feb 28 '23 04:02 trpipher

The reproduction is missing a sign-in page, and it does not reproduce the described issue.

Nonetheless, for server components, the recommended way to receive the session is getServerSession. https://next-auth.js.org/configuration/nextjs#in-app-directory

Therefore, you also don't need SessionProvider within the app directory.

balazsorban44 avatar Feb 28 '23 11:02 balazsorban44

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the incomplete label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template), but you can also use a tool like CodeSandbox or StackBlitz.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue.

Please test your reproduction against the latest version of NextAuth.js (next-auth@latest) to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the incomplete label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every NextAuth.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

github-actions[bot] avatar Feb 28 '23 11:02 github-actions[bot]

:warning: Unless you are aware, you should immediately replace FACEBOOK_CLIENT_SECRET, GOOGLE_CLIENT_SECRET as they have been compromised! You should not commit secrets in public github repositories :grimacing:

balazsorban44 avatar Feb 28 '23 11:02 balazsorban44

Well stupid me I thought i put my .env in my .gitignore

trpipher avatar Feb 28 '23 16:02 trpipher

I do have a question it's warning me that I am using getServerSession in a server react component [next-auth][warn][EXPERIMENTAL_API] getServerSession is used in a React Server Component. so I thought I should I not be doing that. I can just ignore that?

trpipher avatar Feb 28 '23 16:02 trpipher

Okay I hopefully have a better repo for you here I'm getting an Invalid Compact JWE bug whenever I have my Prisma Adapter Uncommented inside of [...nextauth].ts

trpipher avatar Feb 28 '23 17:02 trpipher

the whole App Router (app/) is under development and opt-in via the experimental.appDir flag in Next.js, hence the experimental warning.

balazsorban44 avatar Mar 01 '23 03:03 balazsorban44