Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling performance config setting in Vue 3

When trying to enable the performance setting in Vue 3 I get the following error:

TypeError: can't access property "performance", app.config is undefined

My entry point (main.js) looks like this:

import App from './App.vue';
import { createApp } from 'vue';

const app = createApp(App).mount('#app');

if (process.env.NODE_ENV === 'development') {
    app.config.performance = true;
}
like image 830
Matt Deacalion Avatar asked Dec 06 '25 18:12

Matt Deacalion


1 Answers

This was due to mount not returning an app instance.

Solution:

const app = createApp(App);

if (process.env.NODE_ENV === 'development') {
    app.config.performance = true;
}

app.mount('#app');
like image 154
Matt Deacalion Avatar answered Dec 08 '25 06:12

Matt Deacalion



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!