我遇見的場景:下載包 yarn add @vueuse/core 在某個文件引入使用就報錯。
解決方法,

在vue.congif.js文件里添加配置

代碼:
??configureWebpack:?{
????module:?{
??????rules:?[
????????{
??????????include:?/node_modules/,
??????????test:?/\.mjs$/,
??????????type:?'javascript/auto'
????????}
??????]
????}
??}
希望對你有所幫助