-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Error: headers was called outside a request scope, when using Authjs v5.0.0-beta.19 and next dev --turbo #69516
Comments
Did you use next@canary? The reproduction shows 14.2: https://github.com/cogb-jclaney/authjs-issue/blob/main/package.json#L40 |
Hi Tim, yes, although the repro (not mine) shows 14.2, in my case I was using next@canary and also react@canary. |
Hi @fprl, I could not reproduce any issues, given the reproduction URL! The error on the screenshots looks to be from a different codebase than the code itself. Can you give reproduction steps with the simplified codebase? |
Hi @balazsorban44 thanks for checking it out. Yes, the image is mine but the issue from next-auth was using the same version as I did. I will create a new repro and link it here. |
Make sure to check out with the latest version, which is 5.0.0-beta.21 as of writing |
Clear, thanks a lot |
Sorry for my delay. I've been debugging this issue and I realise that this error appears only in a monorepo setup. Is there some way to debug this in a better way? |
I upgrade next-auth to 5.0.0-beta.21 and it works like a charm. |
Still an issue in beta 25, linked issue in authjs: nextauthjs/next-auth#11076 |
Link to the code that reproduces this issue
https://github.com/cogb-jclaney/authjs-issue
To Reproduce
Hi, I'm bringing this issue nextauthjs/next-auth#11076 to here as its related to turbopack.
Current vs. Expected behavior
Expected behavior should be to work, as it does when there is no --turbo flag.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:21 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 22.0.0 npm: 10.5.1 Yarn: 3.6.3 pnpm: 9.8.0 Relevant Packages: next: 14.2.7 // Latest available version is detected (14.2.7). eslint-config-next: 14.2.7 react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config:
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: