Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
cadebryant2 years ago
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
    2 years ago

    Hey

    @822938405817942046

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

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.