Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

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

Writer Andrew Mclaughlin

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=""></script>
<div>{{ foo }}</div>
1

3 Answers

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="" with a global.prod CDN build: (i.e: src=""):

const App = { data: () => ({ foo: 'bar' })
};
Vue.createApp(App).mount('#app');
<script src=""></script>
<div>{{ foo }}</div>
0

productionTip has been defaulted to false for production in Vue 3.x. It's now only for dev. Check Vuejs official documentation.

1

write this

const app = createApp(App)
app.config.warnHandler = function (msg, vm, trace) { return null
}

Done!

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.