Skip to content

Commit cfca402

Browse files
authored
fix: avoid return loaded prisma if undefined (#461)
1 parent 97ea2f6 commit cfca402

File tree

1 file changed

+3
-1
lines changed
  • packages/runtime/src/enhancements

1 file changed

+3
-1
lines changed

packages/runtime/src/enhancements/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ function loadPrismaModule(prisma: any) {
6262
if (prisma._engineConfig?.datamodelPath) {
6363
const loadPath = path.dirname(prisma._engineConfig.datamodelPath);
6464
try {
65-
return require(loadPath).Prisma;
65+
const _prisma = require(loadPath).Prisma;
66+
if (typeof _prisma !== 'undefined') return _prisma;
67+
return require('@prisma/client/runtime');
6668
} catch {
6769
return require('@prisma/client/runtime');
6870
}

0 commit comments

Comments
 (0)