Closed gogapps closed 1 year ago
It was apparently removed in Prisma 4.14.0
: https://github.com/SoftwareBrothers/adminjs-prisma/issues/35
We don't have an official "fix" for this yet as it would also probably require us to release a breaking change release. I'm more inclined towards limiting @adminjs/prisma
to prisma versions lower than 4.14.0
Can you please specify which version is supported by the AdminJS (would be nice if this has also been updated in the docs)
Can you please specify which version is supported by the AdminJS (would be nice if this has also been updated in the docs)
Any version less than 4.14 (4.13 for example) is supported by AdminJS. 4.14+ will require a breaking change.
It was apparently removed in Prisma
4.14.0
: SoftwareBrothers/adminjs-prisma#35We don't have an official "fix" for this yet as it would also probably require us to release a breaking change release. I'm more inclined towards limiting
@adminjs/prisma
to prisma versions lower than4.14.0
I don't think limiting it to older versions is a good decision (bugs, security vulnerabilities, etc. can occur). IMHO, we should upgrade the major version of @adminjs/prisma
to include a breaking change.
It was apparently removed in Prisma
4.14.0
: SoftwareBrothers/adminjs-prisma#35We don't have an official "fix" for this yet as it would also probably require us to release a breaking change release. I'm more inclined towards limiting
@adminjs/prisma
to prisma versions lower than4.14.0
Hey @dziraf, thanks for looking into this.
I totally get where you're coming from, but holding back at Prisma 4.14.0 kinda keeps us all from some really important fixes and features of later versions. I reckon many of us users would be up for dealing with a bit of a shake-up in AdminJS if it means we can tap into the newer Prisma stuff. Keeping up with Prisma's updates is pretty key for us.
This should be fixed in @adminjs/prisma@5.0.0
. The setup's changed a little, but it's documented in README
@dziraf thank you, appreciated!
same problem. hope to solve this soon.
@dziraf thank you for the solution! I got AdminJS working with Nestjs using this config, in case someone needs some help with it.
I adapted the solution on the current docs with the new resource declaration:
@Module({
imports: [
// AdminJS version 7 is ESM-only. In order to import it, you have to use dynamic imports.
import('@adminjs/nestjs').then(({ AdminModule }) =>
AdminModule.createAdminAsync({
useFactory: () => {
const prisma = new PrismaService();
return {
adminJsOptions: {
rootPath: '/admin',
resources: [
{
resource: {
model: AdminJSPrisma.getModelByName('Product'),
client: prisma,
},
options: {},
},
//... every Prisma model that you need to use on AdminJs
]
}
}
})
//....
What happened?
Use AdminJS with Fastify and Prisma
Bug prevalence
When I start the server
AdminJS dependencies version
"dependencies": { "@adminjs/fastify": "^4.0.0", "@adminjs/prisma": "^4.0.0", "@fastify/cors": "^8.2.1", "@fastify/env": "^4.2.0", "@fastify/jwt": "^6.7.1", "@fastify/multipart": "^7.6.0", "@fastify/session": "^10.3.0", "adminjs": "^7.0.6", "bcrypt": "^5.1.0", "fastify": "^4.17.0", "fastify-plugin": "^4.5.0", "nodemon": "^2.0.22", "prisma": "^4.14.1", "tslib": "^2.5.2", "zod": "^3.21.4" }, "devDependencies": { "@types/bcrypt": "^5.0.0", "@types/node": "^20.2.3", "ts-node": "^10.9.1", "typescript": "^5.0.4", "@prisma/client": "^4.14.1" }
Relevant log output
Relevant code that's giving you issues
Link to recreated demo
here