export ‘unref‘ (imported as unref) was not found in ‘vue‘

本人vue初学,在一次学习过程中加入了另外的一些文件。终端弹出一些warning,到控制台看到以下的错误提示。

实属头疼啊,现在的水平只能看到了 xxx is not a function. 点击定位到app.js的地方也很难理解。有懂的大哥可以指导下这样的错误如何调试为好。。。

问题分析: 

首先我下意识Google了一下这第一个unref在vue中是个什么函数,出现这个错误的原因是什么。

可以查到这是一个与Node.js定时器相关的函数,除此之外,并不能搜到错误相关的信息。

然后我仔细看了下终端提示的warning: 

可以看到: xxx was not found in 'vue'. 并且错误都出自于一个文件@vant下。

结合上面浏览器控制台的错误,大胆猜测是由于vant依赖包版本问题,导致一些函数经历版本被修改了。

再查看资料里的配置文件: 

我的package.json里vant依赖包的版本:

解决方法:

 也许是依赖包的问题? 添加上对应版本的vant尝试一下:

yarn add vant@2.12.15

安装完之后再yarn serve一下,终于能看到一抹清新的绿色和一片干净的控制台了 。

WARN "css.modules" option in vue.config.js is deprecated now, please use "css.requireModuleExtension" instead. INFO Starting development server... 98% after emitting CopyPlugin WARNING Compiled with 17 warnings 09:43:57 warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'computed' was not found in 'vue' warning in ./src/router/index.js "export 'default' (imported as 'VueRouter') was not found in 'vue-router' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'defineComponent' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'getCurrentInstance' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'h' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'inject' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'nextTick' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'onActivated' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'onDeactivated' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'onUnmounted' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'provide' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'reactive' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'ref' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'shallowRef' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'unref' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'watch' was not found in 'vue' warning in ./node_modules/vue-router/dist/vue-router.mjs "export 'watchEffect' was not found in 'vue'这个报错因为什么
06-09
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值