How to better debug this warning? [Vue warn]: Failed to resolve component: ion-card-header

Hello all,

I am currently writing a sample application based on the side menu split-pane starter template:

I have removed much of the original content to give myself a more blank slate. I wanted to display a series of card components in the main screen, so I created a new component called MenuItemCard.


    <ion-card class="menuCard">
        <img :src="imageURL" />
            <ion-card-subtitle>{{ price }}</ion-card-subtitle>
            <ion-card-title>{{ name }}</ion-card-title>
            {{ description }}

This is rendered in the main view (this is folder.vue in the example), but a warning displays in the console.


[Vue warn]: Failed to resolve component: ion-card-header 
  at <MenuItemCard key=1 name="abcde" price=123  ... > 
  at <Anonymous fullscreen=true > 
  at <IonPage isInOutlet=true registerIonPage=fn<registerIonPage> > 
  at <Menu ref=Ref< undefined > key="/folder/Inbox" isInOutlet=true  ... > 
  at <IonRouterOutlet id="main-content" > 
  at <Anonymous content-id="main-content" > 
  at <IonApp> 
  at <App>

This error is repeated for each time the component is rendered. I am not able to identify what <menu > is in this context, it is not displayed in the elements on the page (which might make sense if it didn’t render).

The MenuItemCard component does not have ref imported because the component doesn’t use it (that im aware of, not that i wrote).

However, if i do import ref, and dont use it (which does show a linting type issue)

The Menu component mentioned in the error above, will then show a Proxy object as the value, rather than an undefined value.

<Menu ref=Ref< Proxy {…} > key="/folder/Inbox" isInOutlet=true ... >

So my questions are really:

  1. How can I better understand what this menu item is? It would be helpful if the Ionic component documentation maybe linked to the component source. I’m going to go in search of that next maybe.

  2. Is there some requirement for using the ion-card that I am missing?

  3. Though the error is ocurring at the component, it may be related to the folder.vue page? As the card component should have no menu in it.

Finally I’ll leave the template for the folder.vue page which loads in the MenuItemCards

    <ion-header translucent="true">
        <ion-buttons slot="start">

    <ion-content :fullscreen="true">
<!-- Not actually sure where this secondary header is used/shown, came from example. -->
      <ion-header collapse="condense">
          <ion-title size="large">Title</ion-title>

      <div id="container">
        <menu-item-card v-for="item in menuItems" v-bind:key="" :name="" :price="item.price" :description="item.description" :imageURL="item.imageURL"></menu-item-card>

Thank you.

it just means that you haven’t included the component in the components section of the vue component.

So you need to import it AND and it to the components

<script lang="ts">
import {
  IonCardHeader,  // <== HERE
} from "@ionic/vue";
import { defineComponent, computed, ref } from "vue";
import { useStore } from "vuex";

export default defineComponent({
  name: "Home",
  components: {
    IonCardHeader, ,  // <== AND HERE

You were correct :+1: thank you. Do you know of any good browser debugging tools? Looks like VueTools does not recognize the app as Vue in the browser.

But understand the question? It shows up with the latest vuedevtools