Production build only error: Vuetify Unable to locate target data-app

19,559

Solution 1

Add data-app attribute to the target

<div data-app>
      <MyComponent />
</div>

Solution 2

add v-app

<v-app>
      <MyComponent />
</v-app>
Share:
19,559

Related videos on Youtube

Jake He
Author by

Jake He

Updated on June 05, 2022

Comments

  • Jake He
    Jake He 7 months

    I only get this error in the production build. enter image description here

    I have read this doc and this related issue but I still cannot get it to work. <v-app> is wrapped around the v-dialog why does it still complain?

    Here is my code

    // App.vue
    <template>
      <v-app id="inspire">
        <v-dialog max-width="500px">
          <v-card>
            <v-card-title>
              Create
            </v-card-title>
          </v-card>
        </v-dialog>
      </v-app>
    </template>
    
    \\main.js
    import Vue from "vue";
    import store from "./store/store";
    import Vuetify from "vuetify";
    import "vuetify/dist/vuetify.min.css";
    import App from "./App.vue";
    Vue.use(Vuetify);
    Vue.config.productionTip = false;
    new Vue({
      el: "#app",
      store,
      render: h => h(App)
    });
    
  • Ari over 2 years
    Why is this necessary?
  • Kellen almost 2 years
    This fixed the issue for me, but I am also curious as to what data-app actually is for? I can't seem to find any info about it.
  • pkid169
    pkid169 over 1 year
    @Kellen Vuetify requires your app to be wrapped around by v-app which then adds this data-app automatically for you. So ideally you should do that, otherwise doing it manually as suggested here should work too.

Related