Parallel Routes error too many connections #74454
Unanswered
ggukggukee
asked this question in
App Router
Replies: 1 comment 4 replies
-
|
Shouldn't you do this: I've searched a bit around, and people do use somewhat similar solutions, even Prisma and Next.js docs, but doing: means that, if many modules, on this JavaScript context pass, invoke a client, it'll invoke just as many. Should be fine, IIRC, won't be missing with globals either, and will reuse an already created client. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How properly fetch data for parallel routes without hitting connection limit?
For example in
layout.tsxpage i have 4 suspenses and i assume they are fetch at the same time and each one create new prisma connection and if 3 or more people open a website it throw error that i reached the limit.And here is
@/lib/prisma.tsfileWhat should i do?
Add 100ms timeout after first suspense so it will not create new connection for each suspense?
Beta Was this translation helpful? Give feedback.
All reactions