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 的问题大差不差,都是不能全局引入,需要在使用的地方去动态引入,看看你的项目当中是否有类似的插件引入方式不对。