花海月
花海月
  • 发布:2023-07-05 09:11
  • 更新:2023-07-05 09:15
  • 阅读:769

uniapp 打包小红书小程序 运行失败

分类:uni-app

1.已经使用npx @dcloudio/uvm alpha 升级到最新版本的核心包
2.已经存在依赖"@dcloudio/uni-mp-xhs": "3.0.0-alpha-3080720230627002" 和手动加入了打包脚本

  1. 报错内容如下
  2. Uncaught ReferenceError: vue is not defined
    at Object.vue (external "vue":1)
    at webpack_require (bootstrap:19)
    at Object../resources/app/extensions/xhs-mp-extension/node_modules/swc-loader/src/index.js??clonedRuleSet-2.use[0]!./resources/app/extensions/xhs-mp-extension/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./resources/app/extensions/xhs-mp-extension/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/app/extensions/xhs-mp-extension/node_modules/@xhs/mp-cli/lib/webpack-config/loaders/ml-loader/index.js??ruleSet[0].use[1]!g:\project\songzan\dist\dev\mp-xhs\pages\travel\index.xhsml?vue&type=template&id=68cda4e8 (cssWithMappingToString.js:32)
    at
    webpack_require
    (bootstrap:19)
    at Object.g:\project\songzan\dist\dev\mp-xhs\pages\travel\index.xhsml?vue&type=template&id=68cda4e8 (g:\project\songzan\dist\dev\mp-xhs\pages\travel\index.xhsml?2e77:23)
    at webpack_require (bootstrap:19)
    at Object.g:\project\songzan\dist\dev\mp-xhs\pages\travel\index.xhsml (g:\project\songzan\dist\dev\mp-xhs\pages\travel\index.xhsml:4)
    at
    webpack_require
    (bootstrap:19)
    at make namespace object:7
    at index.render.js?t=35b53595cf4c5:1339
    5.核心报错就是 vue is not defined 还未到业务层前端就报错了
2023-07-05 09:11 负责人:无 分享
已邀请:
花海月

花海月 (作者)

补充下 在dependencies下是有vue依赖的 并且微信小程序打包后的产物是正常的

要回复问题请先登录注册