Every time I execute my program, I encounter the following error:
Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')
at Proxy.mounted (webpack-internal:///./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/views/HdHistory.vue?vue&type=script&lang=js:563:29)
at eval (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:2811:88)
at callWithErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:296:18)
at callWithAsyncErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:304:17)
at hook.__weh.hook.__weh (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:2791:19)
at flushPostFlushCbs (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:461:41)
at flushJobs (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:499:5)
Here is the code snippet causing the issue :
mounted() {
Promise.all([
this.$http.get('/api/v0/tickets/divisions')
.then((response) => {
this.customer.items = response.data;
}),
this.$http.get('/api/v0/hd/groups')
.then((response) => {
this.groups.items.push(...response.data);
// by default select all
if (this.groups.selected.length === 0) this.groups.selected = this.groups.items
}),
])
.then(() => {
this.timeScaleSelected();
})
.catch((e) => {
console.error(e);
});
},
Can someone provide any insights or solutions?
I am currently in the process of migrating my program from Vue2 to Vue3.