Organization plugin is broken according to typescript 5.9 beta?

full error message:
src/auth.ts:41:9 - error TS2322: Type '{ id: "organization"; endpoints: { createOrganization: { <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: { body: { name: string; slug: string; userId?: string | undefined; logo?: string | undefined; metadata?: Record<...> | undefined; keepCurrentActiveOrganization?: boolean | ...' is not assignable to type 'BetterAuthPlugin'.
Types of property 'schema' are incompatible.
Type '{ team?: { modelName: string | undefined; fields: { name: { type: "string"; required: true; fieldName: string | undefined; }; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; createdAt: { ...; }; updatedAt: { ...; }; }; } | undefined; ...' is not assignable to type 'AuthPluginSchema'.
Property 'team' is incompatible with index signature.
Type '{ modelName: string | undefined; fields: { name: { type: "string"; required: true; fieldName: string | undefined; }; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; createdAt: { ...; }; updatedAt: { ...; }; }; } | undefined' is not assignable to type '{ fields: { [x: string]: FieldAttribute<FieldType>; }; disableMigration?: boolean; modelName?: string; }'.
Type 'undefined' is not assignable to type '{ fields: { [x: string]: FieldAttribute<FieldType>; }; disableMigration?: boolean; modelName?: string; }'.

41 organization({
~~~~~~~~~~~~~~
42 allowUserToCreateOrganization: true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 }),
src/auth.ts:41:9 - error TS2322: Type '{ id: "organization"; endpoints: { createOrganization: { <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: { body: { name: string; slug: string; userId?: string | undefined; logo?: string | undefined; metadata?: Record<...> | undefined; keepCurrentActiveOrganization?: boolean | ...' is not assignable to type 'BetterAuthPlugin'.
Types of property 'schema' are incompatible.
Type '{ team?: { modelName: string | undefined; fields: { name: { type: "string"; required: true; fieldName: string | undefined; }; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; createdAt: { ...; }; updatedAt: { ...; }; }; } | undefined; ...' is not assignable to type 'AuthPluginSchema'.
Property 'team' is incompatible with index signature.
Type '{ modelName: string | undefined; fields: { name: { type: "string"; required: true; fieldName: string | undefined; }; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; createdAt: { ...; }; updatedAt: { ...; }; }; } | undefined' is not assignable to type '{ fields: { [x: string]: FieldAttribute<FieldType>; }; disableMigration?: boolean; modelName?: string; }'.
Type 'undefined' is not assignable to type '{ fields: { [x: string]: FieldAttribute<FieldType>; }; disableMigration?: boolean; modelName?: string; }'.

41 organization({
~~~~~~~~~~~~~~
42 allowUserToCreateOrganization: true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 }),
1 Reply
Mendy Landa
Mendy Landa3mo ago
Having the same issue

Did you find this page helpful?