79549807

Date: 2025-04-02 06:16:07
Score: 1
Natty:
Report link

I have found the answer to my situation

I was not using 'use client' at the top of my function that was calling the database. I thought that Next.js automatically loads pages as server components so I assumed it didn't need the clarification. Kind of a stupid but common mistake so I hope anyone who has the same issue checks that every function they use their environment variables in should be marked 'use client'.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Ethan Deardorff