Reputation: 10312
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;
}
Upvotes: 3
Views: 1989
Reputation: 10312
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');
Upvotes: 3