`findVersions()` function: `collection:` property cannot be set

default discord avatar
cadebryant
last month
1

I am attempting to use the

findVersions()

function as described here:


https://payloadcms.com/docs/versions/overview

Hovever, when I try to implement it as directed (see code snippet below, I see a red error squiggly line under the

collection:

parameter, with the message

Type 'string is not assignable to type 'never'......The expected type comes from property 'collection' which is declated here on type Options<never>

.


const result = await payload.findVersions({
  collection: "institutions",
  depth: 2,
  page: 1,
  //other properties
})


How can this be the case, given that I'm doing everything exactly according to the documentation?



It appears that this error is inconsequential; I ran

findVersions()

despite the error and it worked as expected. 🙂

  • discord user avatar
    seanzubrickas
    Payload Team
    last month

    Hey @cadebryant glad you got this sorted out - apologies we didn't get back to you sooner - we were slammed prepping for 2.0.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.