The problem is hot reloading. Next.js re-evaluates the module on every save, so the module-level state is thrown away and a fresh connection is opened.
Cache the connection on globalThis, which survives module reloads:
Caching the promise as well as the connection matters — without it, concurrent requests during a cold start each kick off their own connect().