#Property does not exist on type "unknown" in siblingdata - typescript error

1 messages · Page 1 of 1 (latest)

zinc glacier
#

Hi, I am trying to use filterOptions to set the available options in a "relationship" field based on a value picked in another relationship field. It works perfectly when I just run it with npm run dev, but I keep running into a typescript error whenever I try to build.

The error is due to siblingData prop in filterOptions being set to "unknown"/any, and I'm trying to refer to a field within siblingData. I added an image of the code along with the error I'm getting. I tried to generate and re-generate the types - do I have to import the generated types instead/in addition to CollectionConfig?

Any help is appreciated!

fair basalt
#

Same issue did you find any solution

boreal talon
#

@zinc glacier Good morning Kida - happy to help solve this. Does regenerating types help?

#

Wondering if maybe that need to be run

#

Also, good morning @fair basalt

zinc glacier
#

I did try to regenerate type. But I eventually solved it by using siblingData['game_id'] , instead of siblingData.game_id

thorny glen
#

You can use "data" and pass your collection type to FilterOptionsProps instead for siblingData, siblingData is always "unkown" type in Payload