Search code examples
vue.jsvuejs3

How do I turn off the productionTip warning in Vue 3?


In Vue 2 one could use

Vue.config.productionTip = false;

to turn off the productionTip warning on development builds. However it doesn't work with Vue 3:

Vue.config && (Vue.config.productionTip = false);

const App = {
  data: () => ({
    foo: 'bar'
  })
};
Vue.createApp(App).mount('#app');
<script src="https://unpkg.com/vue@3"></script>
<div id="app">{{ foo }}</div>


Solution

  • According to documentation it was removed.

    So, if you want to get rid of the warning in your Vue 3 Stack Overflow answers (without disabling the console in the snippet), you have to replace src="https://unpkg.com/vue" with a global.prod CDN build: (i.e: src="https://unpkg.com/vue/dist/vue.global.prod.js"):

    const App = {
      data: () => ({
        foo: 'bar'
      })
    };
    Vue.createApp(App).mount('#app');
    <script src="https://unpkg.com/vue/dist/vue.global.prod.js"></script>
    <div id="app">{{ foo }}</div>