fozero
fozero
  • 发布:2023-11-22 18:33
  • 更新:2023-11-23 10:29
  • 阅读:1559

【报Bug】引入第三方组件后报错"openBlock" is not exported by "node_modules/@dcloudio/uni-mp-vue

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 22621.2715

第三方开发者工具版本号: 最新vscode

基础库版本号: node v16.20.2 vue3+vite

项目创建方式: CLI

CLI版本号: npx degit dcloudio/uni-preset-vue#vite my-vue3-project

示例代码:

"dependencies": {
"vue-vital-sign-camera": "https://sdk.panoptic.ai/npm/vue-vital-sign-camera-1.0.8.tgz",
}

import { VitalSignCamera } from "vue-vital-sign-camera";
components: {
VitalSignCamera,
},

操作步骤:

1.安装依赖"vue-vital-sign-camera": "https://sdk.panoptic.ai/npm/vue-vital-sign-camera-1.0.8.tgz",
2.vue中引入并注册组件vue-vital-sign-camera
import { VitalSignCamera } from "vue-vital-sign-camera";
components: {
VitalSignCamera,
},

预期结果:

正常引入并使用组件

实际结果:

引入后报错:

"openBlock" is not exported by "node_modules/@dcloudio/uni-mp-vue/dist/vue.runtime.esm.js", imported by "node_modules/vue-vital-sign-camera/dist/vital-sign-camera.js".  
at ../node_modules/vue-vital-sign-camera/dist/vital-sign-camera.js:4:50  
  2: var At = (t, e, i) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;  
  3: var M = (t, e, i) => (At(t, typeof e != "symbol" ? e + "" : e, i), i);  
  4: import { defineComponent as Ft, useCssVars as jt, openBlock as Ut, createElementBlock as Ht } from "vue";  
                                                       ^  
  5: import zt from "@mediapipe/face_mesh";  
  6: function Nt(t, e) {

bug描述:

在vue组件中引入vue-vital-sign-camera第三方库
import { VitalSignCamera } from "vue-vital-sign-camera";
components: {
VitalSignCamera,
},

引入后报错:

"openBlock" is not exported by "node_modules/@dcloudio/uni-mp-vue/dist/vue.runtime.esm.js", imported by "node_modules/vue-vital-sign-camera/dist/vital-sign-camera.js".  
at ../node_modules/vue-vital-sign-camera/dist/vital-sign-camera.js:4:50  
  2: var At = (t, e, i) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;  
  3: var M = (t, e, i) => (At(t, typeof e != "symbol" ? e + "" : e, i), i);  
  4: import { defineComponent as Ft, useCssVars as jt, openBlock as Ut, createElementBlock as Ht } from "vue";  
                                                       ^  
  5: import zt from "@mediapipe/face_mesh";  
  6: function Nt(t, e) {
2023-11-22 18:33 负责人:无 分享
已邀请:
DCloud_UNI_LXH

DCloud_UNI_LXH

那就是该 npm 包不支持微信小程序

要回复问题请先登录注册