#Custom Collections causing type error in relationTo field

1 messages · Page 1 of 1 (latest)

wet umbra
#

I have created a custom global "menus" and a custom collection "illustrations". The illustrations works exactly the same as media but only for illustrations. When typing to use the illustrations in a field for a component: {
name: 'illustration',
type: 'relationship',
relationTo: 'illustrations',
},

I am getting a type error:
Type '"illustrations"' is not assignable to type 'CollectionSlug | CollectionSlug[]'.ts(2322)
(property) relationTo: CollectionSlug[]

do i have to manually extent the CollectionSlug type? or is there a better way of doing this?

wet umbra
#

pnpm payload generate:types was the fix XD

old bolt
#

Glad you fixed it!