Repeatedly getting CONNECT_TIMEOUT and MaxClientsInSessionMode during local development.
Hello. I am using Nextjs 16. During local development, when I call database from drizzle, I get a CONNECT_TIMEOUT or sometimes MaxClientsInSessionMode if I trigger Nextjs hot reload quickly. My initial guess was that I was probably creating a lot of connections during hot module reloads. Also I switched to transactional connect rather than session pooler based on this https://github.com/orgs/supabase/discussions/22305. So I implemented this Singleton pattern, which still doesn't work -
I am still getting this issue after every 5/6 consecutive calls to the database during Hot Module Refresh. What to do? Please help.
I am still getting this issue after every 5/6 consecutive calls to the database during Hot Module Refresh. What to do? Please help.
error.txt7.16KB