A major gotcha is that many pages in NextJS are statically generated, so if you are expecting to use SSR to fetch certain environment variables, it won't work unless the variables are also available during build time.
You can fix this by using await connection();, see https://nextjs.org/docs/app/api-reference/functions/connection.