N
Neonβ€’12mo ago
metropolitan-bronze

connection terminated on vercel

I'm running a remix app on vercel with prisma. The connection happens through @neondatabase/serverless@0.9.3 and @prisma/adapter-neon (changelog indicates that there isn't much changes between 0.9.3 and latest). I'm experiencing Unhandled Rejection: Error: Connection terminated unexpectedly and Error: socket hang up on file:///var/task/node_modules/.pnpm/@neondatabase+serverless@0.9.3/node_modules/@neondatabase/serverless/index.mjs. Nothing on my neon dashboard is showing issues. It does not happen consistently. The query does return a big payload: 1.3MB spread out on 433 records, it is sent compressed to the client so it isn't that heavy. My assumption is that the size of the results is causing this issue. Am I correct? The result size is kind of outrageous πŸ™ˆπŸ˜… so I'll be filtering what data I actually need on the page. I guess my questions are: 1. is the connection terminated because of the result size? 2. if so is there any configuration we can rely on to mitigate this issue? 3. if not, is there a limit I should pay attention to? so in the future I can monitor this, and change the way I load data.
3 Replies
exotic-emerald
exotic-emeraldβ€’12mo ago
@pepe-le-moko - Can you share a GitHub repository of your code that's enough to reproduce the error even intermittently? - Also, I see that you're using Prisma with Neon, Remix and Vercel. Can you update the prisma server file to be as https://github.com/neondatabase/examples/blob/main/with-nextjs-prisma-edge/lib/prisma.server.ts for creating an instance, and update the Neon's serverless driver to latest in your project and then check?
GitHub
examples/with-nextjs-prisma-edge/lib/prisma.server.ts at main Β· neo...
Examples and code snippets demonstrating common ways of integrating Neon with various frameworks and languages. - neondatabase/examples
metropolitan-bronze
metropolitan-bronzeOPβ€’12mo ago
sorry, just catched up on discord! thanks for the connection example, I didn't have neonConfig.poolQueryViaFetch = true so I'll add this and see if I see the error again. I don't want to spend time just yet on creating a repo since I think there are so work I can do on my side to improve the call.
exotic-emerald
exotic-emeraldβ€’12mo ago
Sounds good, do let me know if I can help you in any way.

Did you find this page helpful?