I am trying to use Prisma.js in my express app. but I am getting error on module import. I am not sure where am I going wrong.
'use strict';
var sql = require('../connection.js');
import { PrismaClient } from '@prisma/client';
//const prisma = new PrismaClient()
class InvoiceService {
constructor(){
}
getInvoices(body,query,user){
return new Promise(function (resolve, reject) {
resolve(query);
});
}
}
module.exports = {InvoiceService};
Change the import to:
const { PrismaClient } = require('@prisma/client');
And it will work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With