VUE报错——[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not...

1. 问题

开发 uni-app 项目时,发生报错:

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

2. 解决

在网上查了相关问题,有的人是因为在 vue3 中使用了 piana 产生的问题,useStore不能全局使用,需要在使用的地方单独引用

而我这里产生的原因是使用了 flv.js 插件并以下面的方式引入导致的:

import flvjs from "flv.js";

解决方法:

const flvjs = await import("flv.js/dist/flv.min.js");

其实和网上的 piana 的问题大差不差,都是不能全局引入,需要在使用的地方去动态引入,看看你的项目当中是否有类似的插件引入方式不对。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值