J Giri
07/09/2021, 9:07 PM"@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
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
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
?Ryan
07/12/2021, 5:27 AM@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 Giri
07/12/2021, 7:06 AM@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 othersRyan
07/12/2021, 7:09 AMJ Giri
07/12/2021, 7:16 AMJ Giri
07/12/2021, 7:25 AMRyan
07/12/2021, 7:31 AMJ Giri
07/12/2021, 7:36 AMJ Giri
07/13/2021, 5:32 PM