From e9208208dc8da5f5690f861b6bbbcb6be48af44d Mon Sep 17 00:00:00 2001 From: Zhandos Mukatayev <77268705+zhandosm@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:29:04 +0900 Subject: [PATCH] Update 400-nextjs-prisma-client-dev-practices.mdx (#5384) * Update 400-nextjs-prisma-client-dev-practices.mdx - Add extension to the `db` file as file=./db was a bit misleading Result: file=./db.ts * Update content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx --------- Co-authored-by: Alex Ruheni <33921841+ruheni@users.noreply.github.com> --- .../400-nextjs-prisma-client-dev-practices.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx b/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx index 1f055a4a92..7e7906bd2f 100644 --- a/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx +++ b/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx @@ -20,7 +20,7 @@ In development, the command `next dev` clears Node.js cache on run. This in turn The solution in this case is to instantiate a single instance `PrismaClient` and save it on the [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) object. Then we keep a check to only instantiate `PrismaClient` if it's not on the `globalThis` object otherwise use the same instance again if already present to prevent instantiating extra `PrismaClient` instances. -```ts file=./db +```ts file=db.ts import { PrismaClient } from '@prisma/client' const prismaClientSingleton = () => {