PrismaP
Prisma7mo ago
6 replies
rando

Inconsistent client generations (build breaking)

I’m using Prisma + Cloudflare D1, it took a long time to find the magic configuration, and it’s mostly worked up until now.

This is my config:

generator client {
  provider               = "prisma-client"
  output                 = "../generated/prisma"
  previewFeatures        = ["driverAdapters", "queryCompiler"]
  generatedFileExtension = "ts"
  importFileExtension    = "ts"
  moduleFormat           = "esm"
  runtime                = "cloudflare"
}


My issue is sometimes this generates an index file, sometimes it doesn’t.

With no config change at all, this can go from working to broken. I have two projects on a monorepo using the exact same config, yesterday I had to generate the client multiple times for A to get an index, while B worked completely fine.

Today with no changes, A is generating an index file, B is not.

I cannot import PrismaClient via the client file.

If I do this:

import { PrismaClient } from "../generated/prisma/client.ts";


It will say the @prisma/client module doesn’t exist.

If I’m able to do this:

import { PrismaClient } from "../generated/prisma";


It works perfectly fine.

First question, before I start spending time on repros, roolbacks and version shenannigans. Is anyone else experiencing this?
2025-06-25_08_45_42-ethang-monorepo_schema.prisma.png
2025-06-25_08_45_33-ethang-monorepo_schema.prisma.png
Was this page helpful?