Error: ❌Attempted to access a server-side environment variable on the client - Weird T3 Stack bug
So I am trying to check if a
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
For example
This is the repo btw: https://github.com/sommeeeer/migotos
Anyone know what this might be? Seems like a weird t3 stack bug.
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.


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