N
Neon2w ago
optimistic-gold

Hello, i need help on this issue. I

Hello, i need help on this issue. I setup user authentication using drizzle, better auth and Neon for my nextjs app. Now, I tried to get user session on the client side so I can display username or email in the header section. I have gotten a couple of errors like “failed to get session” and others in the attached images. Now, I can even login using user credentials or OAuth. I noticed the Neon compute is “suspended”. All my efforts to resolve this since last night hasn’t been successful.
No description
No description
No description
5 Replies
complex-teal
complex-teal2w ago
Hey! Are you making the getSession() call from a server component? The Neon compute going into suspended in completely normal, that's just it scaling to zero when it hasn't been used in more than 5 minutes. I'll become active when you use it again.
dependent-tan
dependent-tan2w ago
Yes, I wrapped the authClient.getSession() in useEffect. I also tried using useSession() that doesn’t work
dependent-tan
dependent-tan2w ago
Now I can’t access my tables. Loading for long period of time then fails
No description
No description
complex-teal
complex-teal2w ago
Are you able able to connect to the database using psql? For your other issue, would you mind sharing the code for the component where you’re calling getSession() (or useSession())? And if that component calls a server action to fetch the session, could you paste that as well?
dependent-tan
dependent-tan2w ago
I just fixed this

Did you find this page helpful?