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:
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:
It will say the @prisma/client module doesn’t exist.
If I’m able to do this:
It works perfectly fine.
First question, before I start spending time on repros, roolbacks and version shenannigans. Is anyone else experiencing this?


5 Replies
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into
#ask-ai if you get antsy for a second opinion!Hey!
This is occurring in latest prisma version - 6.10.1?
I haven't encountered this error before. If this issue is occuring consistently then it would be very helpful if you can provide a minimal reproduction of this issue.
Someone commented and deleted that this has been happening for them as well.
I'll note that if I make sure to
rimraf the prisma/generated across all projects, the index file is gone.
@Nurul was the index file generation removed in recent versions?@rando, yes https://github.com/prisma/prisma/pull/27394
GitHub
feat(generator): ORM-854 drop index.ts from new generator by FGoess...
For the new generator client.ts should be used as the entrypoint to follow proper ESM conventions which do not support index.ts/js as default directory exports.
ty, this is a major breaking change and it looks like part of the problem is the prisma generator doesn't cleanup files @Nurul
I think it’s safe to conclude what I’m seeing is a combination of an old index file sticking around post generation, import changes, and this switch to removing the index file.