[Vuejs]-Vuejs : "this" in 3rd party library is "undefined"

0👍

I have finally fixed this issue.

This issue only presents when I have a local copy of the library in my project (I had it under “scripts” with other javascript util files).

When I added the library by adding it to package.json/package-lock.json and then ran “npm install” the library loads correctly and I no longer see any errors

package.json

"dependencies": {
    "theLibrary": "https://.......",
    "core-js": "^2.6.5",
    "vue": "^2.6.10",
    "vue-router": "^3.1.3"
},

package-lock.json

"dependencies": {
    ......
    "theLibrary": {
        "version": "https:.....",
         "integrity": ".....
    },
    ......
}

npm command

npm install theLibrary 

Leave a comment