Hey all... I was wondering if someone could help m...
# orm-help
d
Hey all... I was wondering if someone could help me with some some Prisma/SvelteKit issues I'm having. Since PrismaClient isn't an ES module I have a shim to make it work both during development and in build for production. But now I'm having an issue with too many prisma clients being instantiated due to hot module reloading (during development) and I can't figure out how to use a global variable in TypeScript to store the client in the global across module reloads. Was wondering if anybody could help me figure out a solution? First screenshot is the shim for ESM and the second screenshot is Prisma's recommended way in the docs to store the prisma client in a global variable for reuse across hot module reloads during development
There's a couple other ways I've seen people try to resolve the first issue, [2] and [3]