Property doesn't exist on type in nuxtjs 3

Hey, I created nuxtjs app with slicemachine. I still have problems with Typescript. When I fetch something from the API, the wrong types are assigned to it. Or I'm doing something wrong.
That's what I mean.
That's one of the code, where I'm fetching data and then I iterates over the array where unfortunately I cannot access my navi_link. This is one of the slice.


That's type script error I getting.

The page is working, but I don't know if there's something I'm doing wrong and this error in vsc annoys me

Hi Piotr,

My best guess is that you need an isFilled() guard here, maybe something like:

<li 
  v-for="(item, i) in home?.data.navi_link" 
  v-if="$prismic.isFilled(home?.data.navi_link)"
  :key="i" 
/>

Let me know if that helps.

Sam

Hey, I tried that and that is result.


Btw even if I tried in diffrent way it doesn't work as well. The message is still the same.

Hi Piotr,

I think I misread your code. Is navi_link a content relationship?

If that's the case, do you have GraphQuery or FetchLinks implemented and working properly?

If so, to get the type working you'll need a little workaround, which you can find here:

Sam