-
Notifications
You must be signed in to change notification settings - Fork 714
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Contact Details
What happened?
In Prisma v6.8.x the prisma client is imported from the generated code like below:
import { PrismaClient } from './generated/prisma'
Building the project gives the following error:
SyntaxError: The requested module '@prisma/client' does not provide an export named 'Prisma'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:146:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:229:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
which is originating from the following AdminJs code:
import { Prisma } from '@prisma/client';
export const getEnums = (clientModule) => {
const dmmf = clientModule?.Prisma.dmmf.datamodel ?? Prisma.dmmf.datamodel;
return dmmf.enums.reduce((memo, current) => {
// eslint-disable-next-line no-param-reassign
memo[current.name] = current;
return memo;
}, {});
};
Please, advise how to work around it.
Bug prevalence
100% of time when building my project
AdminJS dependencies version
"@adminjs/design-system": "^4.1.1"
"@adminjs/express": "^6.1.1"
"@adminjs/prisma": "^5.0.3"
What browsers do you see the problem on?
No response
Relevant log output
SyntaxError: The requested module '@prisma/client' does not provide an export named 'Prisma'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:146:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:229:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
Relevant code that's giving you issues
import { Prisma } from '@prisma/client';
export const getEnums = (clientModule) => {
const dmmf = clientModule?.Prisma.dmmf.datamodel ?? Prisma.dmmf.datamodel;
return dmmf.enums.reduce((memo, current) => {
// eslint-disable-next-line no-param-reassign
memo[current.name] = current;
return memo;
}, {});
d-vanhees-micoworks
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working