Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix 'Cannot read property '_wrapper' of undefined' error when using webpack with Vue?

I use axios to get information from DB. I get response from server in array:

response

My html tags: htmlTag

Js code looks like this:

    data() {
        return {
            departments: {
                id: 0,
                name: "name of company",
                nameZod: "name of company dif"
                },
            };
       },
    created() {
        axios
            .get('/SomeController/Departments')
            .then(response => {
                this.departments = response.data;
                console.log(this.departments);
            })
        }

I get an error: Cannot read property '_wrapper' of undefined. Its very strange cause I use similar code in other module and it works correctly.

like image 395
Horman Lewis Avatar asked Apr 06 '19 19:04

Horman Lewis


1 Answers

Maybe you have defined a function call somewhere (@click=something) and you haven't defined yet the function in methods. This happened to me, maybe it can be useful for someone

like image 99
alagaesia Avatar answered Oct 07 '22 18:10

alagaesia