Skip to content

[Bug]: PrismaClient adapter option not available with new prisma-client generator in 6.16.0 #28073

@medz

Description

@medz

Bug description

After upgrading to Prisma 6.16.0 and using the new ESM-first generator, the option is no longer available on the constructor, causing TypeScript errors and runtime errors.

How to reproduce

  1. Configure Prisma schema with the new generator:
generator client {
    provider     = "prisma-client"
    output       = "../generated/prisma"
    engineType   = "client"
    runtime      = "workerd"
    moduleFormat = "esm"
}

datasource db {
    provider = "sqlite"
    url      = env("DATABASE_URL")
}
  1. Try to instantiate PrismaClient with adapter:
import { PrismaD1 } from "@prisma/adapter-d1";
import { PrismaClient } from "~/generated/prisma/client";

const adapter = new PrismaD1(DATABASE);
const prisma = new PrismaClient({ adapter }); // TypeScript error

Expected behavior

The option should be available on PrismaClient constructor when using driver adapters, as documented in the 6.16.0 release notes for the Rust-free ORM.

Actual behavior

TypeScript Error:

Object literal may only specify known properties, and 'adapter' does not exist in type 'Subset<PrismaClientOptions, PrismaClientOptions>'. (ts 2353)

Runtime Error:

{"error":true,"message":"Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.\nPlease either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."}

Investigation findings

  1. The generated code imports from instead of regular runtime
  2. The generated PrismaClientOptions interface doesn't include the adapter property

Generated configuration (from generated/prisma/internal/class.ts)

const config: runtime.GetPrismaClientConfig = {
  "generator": {
    "config": {
      "engineType": "client",
      "moduleFormat": "esm",
      "runtime": "workerd"
    }
  }
}

Environment & setup

  • OS: macOS
  • Database: Cloudflare D1 (SQLite with @prisma/adapter-d1)
  • Node.js version: Latest
  • Prisma version: 6.16.0
  • Using: Nitro/Nuxt with Cloudflare Workers

Additional context

This issue appears to be related to the GA release of the new ESM-first generator in 6.16.0. The issue prevents using driver adapters with the new generator, which is supposed to support the Rust-free ORM with adapters according to the release notes.

Possible workarounds attempted:

  • Changing runtime setting (doesn't affect generated code)
  • Using different import paths (still generates edge runtime)
  • Setting engineType = "client" (already configured)

The issue makes it impossible to use the new generator with driver adapters, forcing users to stay with the legacy generator.

Related to

This might be related to the Rust-free ORM and driver adapter implementation changes in 6.16.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions