David
07/22/2021, 11:04 AMTypeError: prisma_1.default is not a constructor
😕
anyone have any idea why?
basically I just make an index.ts
file and helper.ts
inside that and the content is:
helper.ts
import { PrismaClient } from '@prisma/client';
const client = new PrismaClient()
export default client;
index.ts
export { default } from './helper'
one of my backend app's index file:
import PrismaClient from 'my-library-name';
//just use the PrismaClient I imported like usual
I also tested by adding some console log in helper.ts
and index.ts
and when I run the backend app's, the console.log is printed before the error exception is appear.
---
tl;dr: I want to make a separate folder for the Prisma to shared into 3 different apps. But, I keep failed at importing the PrismaClient.Ryan
07/22/2021, 11:15 AMRyan
07/22/2021, 11:16 AMDavid
07/22/2021, 12:27 PMindex.ts
and write:
export * from '@prisma/client';
in there.
and everything running perfectly fine.
I just need to test for some time to make sure everything running well.
Once again, thanks a lot 😄