-
-
Couldn't load subscription status.
- Fork 126
Description
Brief Outline
Using the new prisma-client breaks zenstack plugins typescript inference which rely on the prisma client import path
Description and expected behavior
Prisma 6.6.0 introduces a new client provider prisma-client
Plugins (from my testing zod & trpc) which import prisma types are now defaulting to import type { Prisma } from '@prisma/client';
Using my example below
generator client {
provider = "prisma-client"
output = "../src/generated/prisma-client"
}
plugin zod {
provider = '@core/zod'
output = './src/generated/zod'
}
generates:
/******************************************************************************
* This file was generated by ZenStack CLI.
******************************************************************************/
/* eslint-disable */
// @ts-nocheck
import { z } from 'zod';
;
import type { Prisma } from '@prisma/client';
;
This breaks the usability of any generated code which relies on the prisma-client types
Expected output:
using provider = "prisma-client-js" outputs correctly:
/******************************************************************************
* This file was generated by ZenStack CLI.
******************************************************************************/
/* eslint-disable */
// @ts-nocheck
import { z } from 'zod';
;
import type { Prisma } from '../../prisma-client';
;
findings
Searching for how the plugin system works. I can see that plugin options receive an options variable which contains the prisma client path.
When looking at how this is computed I can see the code looking for a hard coded prisma-client-js
This might be what is causing the plugins to not receive a prisma client path
https://github.com/search?q=repo%3Azenstackhq%2Fzenstack+%27prisma-client&type=code
Environment
- ZenStack version: 2.14.0
- Prisma version: 6.6.0
- Database type: Postgresql
Additional context
Add any other context about the problem here.