Invalid prop Error Nuxt Prismic JavaScript

Hi there,

I'm currently facing this exact same issue though my main key difference is that my project does not use typescript.

I'm seeing this warning come up for my project that uses Nuxt and Javascript, can anyone help me identify why this is happening and also how I can remove this error from appearing?

The stack of the warning stems from my slice that I've added.

vue.runtime.esm.js?2b0e:4605 [Vue warn]: Invalid prop: type check failed for prop "field". Expected Array, got Undefined 

found in

---> <Hero> at slices/Hero/index.vue
       <SliceZone>
         <IndexPage> at pages/index.vue
           <Nuxt>
             <Default> at layouts/default.vue
               <Root>

And here is how I am getting props in my slice:

import { getSliceComponentProps } from "@prismicio/vue/components";
...
props: getSliceComponentProps(["slice", "index", "slices", "context"]),
...

Hello @developer2,

I apologize for the late response.

Can you share with me more information that would help debug this? Like your file in question and the component you are passing content to.

Thanks,
Racheal.

Hi @racheal.orukele ,

Thanks for getting back to me. I'm not sure what happened, but I had a duplicate component in my components directory since I was converting everything over to slices. And when I removed that component the issue resolved itself. Not sure why that would be, but regardless the issue is now gone for me, thanks!

Glad to hear that the issue is resolved. Let us know if you have any other questions :slightly_smiling_face: