Error: ❌Attempted to access a server-side environment variable on the client - Weird T3 Stack bug

So I am trying to check if a session.user.role === Role.Admin in getServerSideProps() in all the /admin/ routes.

It works well for a lot of the routes, but not on some. Im using the same code to check admin status in all admin routes using getServerSideProps().

For example /admin/news works fine, but when I go to /admin/news/new i get the error.

This is the repo btw: https://github.com/sommeeeer/migotos

Anyone know what this might be? Seems like a weird t3 stack bug.
image.png
image.png
GitHub
Contribute to sommeeeer/migotos development by creating an account on GitHub.
Solution
You're importing uploads3 from your helpers file, which also contains multiple indirect imports of prisma
Was this page helpful?