[Vue3] vue-multiselect TypeError: Cannot read properties of undefined (reading ‘_c’)

ลองเล่น Vue3 + Plugin vue-multiselect พอดีอยากทำ App ครอบตัว Redmine แต่ Run ไป เจอ Error

TypeError: Cannot read properties of undefined (reading '_c')

ตอนแรกก็ติดมา 2 ชั่วโมงเลย ทั้งลองทำตาม Example เค้าแล้ว ถอยจาก TypeScript มาเป็น JavaScript ก็ยังไม่ผ่าน คิดว่าน่าจะบั๊กมาตัว Library เลยลองไปส่อง package.json ตอนนี้ 2.1.7

"dependencies": {
    "pinia": "^2.0.32",
    "vue": "^3.2.47",
    "vue-multiselect": "^2.1.7",
    "vue-router": "^4.1.6"
 },

ลองไปส่องที่ Repo ดู เหมือนจะสุดที่ 2.1.7 แต่ลองไปส่องที่ Releases · shentao/vue-multiselect (github.com) มี 3.0.0-beta.1 ด้วย สำหรับ Vue3 เลยคิดว่าลองแก้ package.json ดู

"dependencies": {
    "pinia": "^2.0.32",
    "vue": "^3.2.47",
    "vue-multiselect": "^3.0.0-beta.1",
    "vue-router": "^4.1.6"
 },

แล้ว Run npm install อีกที สรุปว่าใช้งานได้ครับ ^__^

Reference


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.