關於:vue升級導致TypeError:Cannot read property ‘parseComponent’ of undefined 問題
原因: vue-template-compiler 升級版本后 parseComponent函數已被刪除,導致 component-compiler-utils報錯。
解決辦法: 查看component-compiler-utils最新版本(https://github.com/vuejs/component-compiler-utils/releases)
首先:刪除舊版本:
npm uninstall @vue/component-compiler-utils
然后: 安裝新版本(我目前的最新版本是3.1.2)
npm install --dev @vue/component-compiler-utils@3.1.2
最新版本已經解決對parseComponent的依賴。問題解決。
原文:https://www.codeleading.com/article/70763858694/