-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library is broken with 4.16.0 #91
Comments
Hey @jakeleventhal, thanks for your report, can you provide your prisma schema configuration? Like generators and preview features? |
// Docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
output = "../../../../node_modules/@prisma/client/ecominate"
previewFeatures = ["clientExtensions", "fullTextSearch", "jsonProtocol"]
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator json {
provider = "prisma-json-types-generator"
namespace = "EcominatePrismaJsonTypes"
clientOutput = "../../../../node_modules/@prisma/client/ecominate"
}
/// Data that is used to control global, application-level logic across all users.
model AppData {
id String @id @default(uuid())
/// Whether or not the app is in maintenance mode.
maintenance Boolean @default(false)
/// [StripeCustomerPortalConfig]
/// The Stripe customer portal config.
customerPortal Json?
/// [StripeWebhookConfig]
/// The Stripe webhook config.
stripeWebhook Json?
} import Stripe from 'stripe';
declare global {
namespace EcominatePrismaJsonTypes {
interface StripeCustomerPortalConfig {
id: string;
config: Stripe.BillingPortal.ConfigurationCreateParams;
}
interface StripeWebhookConfig {
id: string;
config: Stripe.WebhookEndpointCreateParams;
}
}
} import './prismaJsonTypesNamespace';
import { Prisma, PrismaClient } from '@prisma/client/ecominate';
const client = (url: string | undefined) =>
new PrismaClient(url ? { datasources: { db: { url } } } : undefined).$extends({
model: {
$allModels: {
async exists<T>(this: T, where: Prisma.Args<T, 'findFirst'>['where']): Promise<boolean> {
const context = Prisma.getExtensionContext(this);
const result = await (context as any).count({ where });
return result > 0;
}
}
}
});
export type ExtendedPrismaClient = ReturnType<typeof client>;
// Export the prisma client
export const getPrismaClient = (url?: string): ExtendedPrismaClient => {
// @ts-ignore
if (typeof window === 'undefined') {
return client(url);
}
// @ts-ignore
return null;
};
const prisma = getPrismaClient();
export default prisma;
export * from './types';
export * from '@prisma/client/ecominate'; |
Hey @jakeleventhal, thanks for almost instantly reporting this bug after prisma 4.16.0 release! It's live at v2.5.0! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
prisma/prisma#19863
The text was updated successfully, but these errors were encountered: