4***@qq.com
4***@qq.com
  • 发布:2023-01-12 11:22
  • 更新:2023-09-17 17:33
  • 阅读:1746

【报Bug】uni-ui部分组件不生效 Component is not found in path "node-modules/@dcloudio/uni-ui/lib/xxx"

分类:uni-app

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

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 企业版

第三方开发者工具版本号: 1.06.2301040 Stable

基础库版本号: 2.14.1 其实大部分都试过都不行

项目创建方式: CLI

CLI版本号: vite 3.2.5

示例代码:

依赖:
"dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-components": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-h5": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-ui": "^1.4.23",
"axios": "^0.26.1",
"crypto-js": "^4.1.1",
"echarts": "^5.1.2",
"lodash.debounce": "^4.0.8",
"lodash.isempty": "^4.4.0",
"lodash.isequal": "^4.5.0",
"lodash.isfinite": "^3.3.2",
"lodash.isplainobject": "^4.0.6",
"moment": "^2.29.4",
"pinia": "^2.0.27",
"query-string": "^7.1.3",
"vue": "^3.2.45",
"vue-i18n": "^9.1.9"
},
"devDependencies": {
"@babel/core": "^7.20.5",
"@babel/eslint-parser": "^7.19.1",
"@dcloudio/types": "^3.0.17",
"@dcloudio/uni-automator": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3061020221121002",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3061020221121002",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3061020221121002",
"@types/crypto-js": "^4.1.1",
"@types/lodash": "^4.14.191",
"@types/lodash.isempty": "^4.4.7",
"@types/lodash.isequal": "^4.5.6",
"@types/lodash.isfinite": "^3.3.7",
"@types/lodash.isplainobject": "^4.0.7",
"@types/node": "^18.11.11",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.8.0",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-normalize": "^10.0.1",
"postcss-preset-env": "^7.8.3",
"postcss-pxtorem": "^6.0.0",
"prettier": "^2.8.1",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.56.1",
"sass-loader": "^10.1.1",
"typescript": "^4.8.4",
"vite": "^3.2.4",
"vite-plugin-chunk-split": "^0.4.6",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-progress": "^0.0.6",
"vite-plugin-require-transform": "^1.0.4"
}

easycom配置:
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
}

vue.config.js:
module.exports = {
transpileDependencies:['@dcloudio/uni-ui']
}

操作步骤:

问题发生组件:uni-calendar、uni-datetime-picker
描述:项目是vue3 + vite + ts 搭建的,想要使用uni-ui,导入方式参照了官方文档,采用easycom导入,安装了sass、sass-loader,配置了easycom,组件导入不生效,直接拷贝组件代码通过自定义组件的方式导入也不行,其他的uni插件正常

预期结果:

正常导入

实际结果:

无法导入

bug描述:

项目使用uni-ui时,部分组件不生效
错误信息: Component is not found in path "node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar"

2023-01-12 11:22 负责人:无 分享
已邀请:
5***@qq.com

5***@qq.com

怪了,我也是WASubContext.js?t=wechat&s=1694916506742&v=3.0.2:1 Component is not found in path "node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons" (using by xxx)

要回复问题请先登录注册