大熊猫玩菜刀
大熊猫玩菜刀
  • 发布:2022-06-21 10:46
  • 更新:2023-06-15 15:35
  • 阅读:1545

hbuilder运行uniapp到微信小程序报错:Cannot find name 'wx'.

分类:uni-app
10:27:48.644 [tsl] ERROR at main.ts:1  
10:27:48.649   TS2339:Property '__webpack_require_UNI_MP_PLUGIN__' does not exist on type 'Wx'.  
10:27:48.649  ERROR  Build failed with errors.

试了下基础工程也报错:

11:34:23.706 [tsl] ERROR at main.ts:1  
11:34:23.706   TS2304:Cannot find name 'wx'.  
11:34:23.706  ERROR  Build failed with errors.

依赖版本:

  "dependencies": {  
    "@dcloudio/uni-app-plus": "^2.0.1-34920220609002",  
    "@dcloudio/uni-h5": "^2.0.1-34920220609002",  
    "@dcloudio/uni-helper-json": "*",  
    "@dcloudio/uni-i18n": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-360": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-alipay": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-baidu": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-jd": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-kuaishou": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-lark": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-qq": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-toutiao": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-vue": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-weixin": "^2.0.1-34920220609002",  
    "@dcloudio/uni-mp-xhs": "^2.0.1-34920220609002",  
    "@dcloudio/uni-quickapp-native": "^2.0.1-34920220609002",  
    "@dcloudio/uni-quickapp-webview": "^2.0.1-34920220609002",  
    "@dcloudio/uni-stat": "^2.0.1-34920220609002",  
    "@vue/shared": "^3.0.0",  
    "core-js": "^3.6.5",  
    "flyio": "^0.6.2",  
    "regenerator-runtime": "^0.12.1",  
    "vue": "^2.6.11",  
    "vue-class-component": "^6.3.2",  
    "vue-property-decorator": "^8.0.0",  
    "vuex": "^3.2.0"  
  },  
  "devDependencies": {  
    "@babel/plugin-syntax-typescript": "^7.2.0",  
    "@babel/runtime": "~7.17.9",  
    "@dcloudio/types": "^3.0.4",  
    "@dcloudio/uni-automator": "^2.0.1-34920220609002",  
    "@dcloudio/uni-cli-i18n": "^2.0.1-34920220609002",  
    "@dcloudio/uni-cli-shared": "^2.0.1-34920220609002",  
    "@dcloudio/uni-migration": "^2.0.1-34920220609002",  
    "@dcloudio/uni-template-compiler": "^2.0.1-34920220609002",  
    "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.1-34920220609002",  
    "@dcloudio/vue-cli-plugin-uni": "^2.0.1-34920220609002",  
    "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.1-34920220609002",  
    "@dcloudio/webpack-uni-mp-loader": "^2.0.1-34920220609002",  
    "@dcloudio/webpack-uni-pages-loader": "^2.0.1-34920220609002",  
    "@vue/cli-plugin-babel": "~4.5.18",  
    "@vue/cli-plugin-typescript": "~4.5.11",  
    "@vue/cli-service": "~4.5.18",  
    "babel-plugin-import": "^1.11.0",  
    "cross-env": "^7.0.2",  
    "jest": "^25.4.0",  
    "mini-types": "*",  
    "miniprogram-api-typings": "*",  
    "postcss-comment": "^2.0.0",  
    "typescript": "^3.0.0",  
    "vue-template-compiler": "^2.6.11"  
  },

hbuilder版本:3.4.15.20220610

依赖版本:"@dcloudio/uni-mp-weixin": "2.0.1-34920220609002",

使用终端cli编译打包正常。

2022-06-21 10:46 负责人:无 分享
已邀请:
a***@51094.com

a***@51094.com - admin

解决了吗, 对于原生的代码都有语法错误

要回复问题请先登录注册