In my nextjs app, the environment variables work only in client components, but not in server components and server actions. Note that the variables work when I run the build task locally, but not when I host on vercel.
const url = ${process.env.NEXT_PUBLIC_BACK_URL}/conversations; when called in server components doesnot read the env variable. How to solve this?
I define the env variables in the vercel dashboard