-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
unstable_getServerSession() not working with nextjs13 #5759
Comments
` export default function Home() { <button onClick={() => signIn("google")}>Signin ); } ` |
This comment was marked as off-topic.
This comment was marked as off-topic.
please provide a proper reproduction. are you using the edge runtime? |
This is a real issue too, which I haven't gotten past because I don't want to install the "v8" package from npm which is clearly not the right "v8" module (and I don't know if it's safe): https://www.npmjs.com/package/v8 Here's the console log:
The import trace points to this line in "openid-client": I think the "v8" module it's trying to require is the native Node.js "v8" module: https://nodejs.org/docs/latest-v18.x/api/v8.html I can Versions:
Not using Turbopack or any experimental Next.js features |
Still, please add a reproduction. You likely use I'm converting this to a discussion, since this is not a NextAuth.js bug. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Environment
System: OS: Windows 10 10.0.22000 CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz Memory: 1.06 GB / 7.89 GB Binaries: Node: 19.0.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.5.3 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 107.0.5304.88 Edge: Spartan (44.22000.120.0), Chromium (107.0.1418.35) Internet Explorer: 11.0.22000.120 npmPackages: next: 13.0.2 => 13.0.2 next-auth: ^4.16.4 => 4.16.4 react: 18.2.0 => 18.2.0
Reproduction URL
#5741
Describe the issue
Hi , I am trying to load session in nextjs13 , unstable_getserversession does not seem to work , I have followed the thread exactly and it gives me the following error
Unhandled Runtime Error Error: PrismaClient is unable to be run in the browser. In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
This error comes after resolving a previous error
Cant find module v8
I installed v8 library using
yarn add v8
after that I encountered prismaclient error.
How to reproduce
Below is the code snippet I am trying to run
`
import { unstable_getServerSession } from "next-auth";
import { signIn, useSession } from "next-auth/react";
import Head from "next/head";
import Image from "next/image";
import styles from "../../styles/Home.module.css";
import { authOptions } from "./api/auth/[...nextauth]";
export default function Home() {
const session = unstable_getServerSession(authOptions);
return (
<button onClick={() => signIn("google")}>Signin
);
}
`
Expected behavior
It should load session on server component .
The text was updated successfully, but these errors were encountered: