PrismaP
Prisma8mo ago
3 replies
Mike

adapter-mongodb

I’ve been trying to implement and use a custom adapter-mongoDB for Prisma, but I'm encountering the following error:
  err: {
      "type": "PrismaClientConstructorValidationError",
      "message": "\"adapter\" property can only be provided to PrismaClient constructor when \"driverAdapters\" preview feature is enabled.\nRead more at https://pris.ly/d/client-constructor",
      "stack":
          PrismaClientConstructorValidationError: "adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.
          Read more at https://pris.ly/d/client-constructor
However, my Prisma schema does include the necessary preview feature:
 generator client {
  provider        = "prisma-client-js"
  output          = "../generated/mongo"
  previewFeatures = ["driverAdapters", "queryCompiler"]
}
So it seems like Prisma isn’t recognizing that driverAdapters is enabled, even though it's clearly specified in the generator block. Any ideas on what might be causing this or how to resolve it?
Was this page helpful?