There are some threads about similar issues, but I still wanted to post.
The following template code (Vue/Nuxt) gives me the error below. Could I use some helper function in the template code to fix this? isFilled? Thanks in advance.
Property 'data' does not exist on type 'ContentRelationshipField<"legal_clause">'.
Property 'data' does not exist on type 'EmptyLinkField<"Document">'.
It looks like you're using fetchLinks, graphQuery, or GraphQL? If so, you'll need to type the content relationship manually. Let me know if you need help with that and I can ask our resident Nuxt expert (though I think she's away on vacation currently).
Thanks for your patience! I looked into this and I think I might have a solution for you. This is based on a solution that our engineer Angelo developed for typing fetchLinks in Next.js, but I've tested it in Nuxt and it seems to be working.
Typically we use the $prismic.isFilled helpers to check if a property exists. However — as you have encountered here — TypeScript doesn't know the structure of the linked data. Angelo wrote a helper to take care of that — isFilledRelatedData() — which you can see here: