I posted an issue with prisma/types-node in stacko...
# orm-help
j
I posted an issue with prisma/types-node in stackoverflow https://stackoverflow.com/questions/68322578/recent-updated-version-of-types-node-is-creating-an-error-the-previous-versi The docs of prisma client instantiation needs to be revised as it having a bug with the latest version of @types/node
"@types/node":ย "^16.3.0"
. It was working fine until day before yesterday with the version ``"@types/node":ย "^15.x.x"``. This is from the doc
Copy code
import { PrismaClient } from "@prisma/client";

// add prisma to the NodeJS global type
interface CustomNodeJsGlobal extends NodeJS.Global {
  prisma: PrismaClient;
}

// Prevent multiple instances of Prisma Client in development
declare const global: CustomNodeJsGlobal;

const prisma = global.prisma || new PrismaClient();

if (process.env.NODE_ENV === "development") global.prisma = prisma;

export default prisma;
I'm getting this error
Copy code
error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
4 interface CustomNodeJsGlobal extends NodeJS.Global
What could i do to make it work with latest version of
@types/node
?
r
@J Giri ๐Ÿ‘‹ If it doesnโ€™t work with the latest version of
@types/node
then it would be great if you could create an issue here so that we can look into this. As a workaround, you would need to stick to the older version of
@types/node
.
j
I got it fixed n working with latest
@types/node
by the accepted answer posted in the mentioned stackoverflow question post. Do i still need to create an issue? But yeah with the given latest node version, the specific part of docs needs to be updated or else it will cause error to all people using it after the recent update of node. I have it working now after i got the answer in stackoverflow but it will create bug for others
r
You can create a docs request here instead of an issue ๐Ÿ™‚
j
Oh! I didnt knew. I'm not exposed to and used to creating issue or things like docs request
I have created an issue just now for this. https://github.com/prisma/docs/issues/2018
๐Ÿ™Œ 1
๐Ÿ’ฏ 1
r
Thanks a lot ๐Ÿ™‚
j
Pleasure is mine ๐Ÿ™‚
The docs request i made is marked with "#2018". When does usually docs update happen once brought into attention that something becomes outdated?