Closed jocstech closed 7 months ago
方便确认一下 0.58.5 是哪个依赖安装的吗?
我也遇到了相同的情况,但是unocss 降级到0.58.9就没有问题
如果忽略ts类型问题,可以正常运行吗?如果可以,就不用管什么东西,如果不行,就先降级到 0.58.9 吧
在 unocss-preset-uni v0.2.8 尝试解决这个问题,这涉及到 unocss v0.59 和 unocss-applet v0.8,请看一下 README 来调整一下依赖,如果7天左右没回应我就会关闭这个issue了 @jocstech @huchaomin
可以,非常感谢 @ModyQyW
描述问题
Type 'Preset Type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.58.5/node_modules/@unocss/core/dist/index").Preset' is not assignable to type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.59.0/node_modules/@unocss/core/dist/index").Preset'.
Types of property 'rules' are incompatible.
Type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.58.5/node_modules/@unocss/core/dist/index").Rule[] | undefined' is not assignable to type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.59.0/node_modules/@unocss/core/dist/index").Rule[] | undefined'.
Type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.58.5/node_modules/@unocss/core/dist/index").Rule[]' is not assignable to type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.59.0/node_modules/@unocss/core/dist/index").Rule[]'.
Type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.58.5/node_modules/@unocss/core/dist/index").Rule' is not assignable to type 'import("/Users/jocs/Projects/hna/uniapph5/node_modules/.pnpm/@unocss+core@0.59.0/node_modules/@unocss/core/dist/index").Rule'.
Type '[RegExp, DynamicMatcher]' is not assignable to type 'Rule'.
Type '[RegExp, DynamicMatcher]' is not assignable to type '[string, CSSObject | CSSEntries] | [RegExp, DynamicMatcher]'.
Type '[RegExp, DynamicMatcher]' is not assignable to type '[string, CSSObject | CSSEntries]'.
Type at position 0 in source is not compatible with type at position 0 in target.
Type 'RegExp' is not assignable to type 'string'.ts(2322)
复现
"dependencies": { "@climblee/uv-ui": "^1.1.20", "@dcloudio/uni-app": "3.0.0-3090920231225001", "@dcloudio/uni-app-plus": "3.0.0-3090920231225001", "@dcloudio/uni-components": "3.0.0-3090920231225001", "@dcloudio/uni-h5": "3.0.0-3090920231225001", "@dcloudio/uni-mp-alipay": "3.0.0-3090920231225001", "@dcloudio/uni-mp-baidu": "3.0.0-3090920231225001", "@dcloudio/uni-mp-jd": "3.0.0-3090920231225001", "@dcloudio/uni-mp-kuaishou": "3.0.0-3090920231225001", "@dcloudio/uni-mp-lark": "3.0.0-3090920231225001", "@dcloudio/uni-mp-qq": "3.0.0-3090920231225001", "@dcloudio/uni-mp-toutiao": "3.0.0-3090920231225001", "@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001", "@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001", "@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001", "@dcloudio/uni-ui": "^1.5.5", "@vueuse/core": "^10.9.0", "colors.ts": "^1.0.20", "crypto-js": "^4.2.0", "date-fns": "^3.6.0", "gio-miniprogram-sdk-cdp": "^3.8.19", "gio-webjs-sdk-cdp": "^3.8.6", "pinia": "2.0.36", "pinia-auto-refs": "^0.0.10", "radash": "^12.1.0", "vconsole": "^3.15.1", "vue": "^3.4.21", "vue-i18n": "^9.11.0" }, "devDependencies": { "@antfu/eslint-config": "^2.12.2", "@dcloudio/types": "^3.4.8", "@dcloudio/uni-automator": "3.0.0-3090920231225001", "@dcloudio/uni-cli-shared": "3.0.0-3090920231225001", "@dcloudio/uni-stacktracey": "3.0.0-3090920231225001", "@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001", "@iconify-json/carbon": "^1.1.31", "@types/node": "^20.12.5", "@uni-helper/eslint-config": "^0.0.6", "@uni-helper/uni-app-types": "^0.5.12", "@uni-helper/uni-env": "^0.1.1", "@uni-helper/uni-ui-types": "^0.5.13", "@uni-helper/unocss-preset-uni": "^0.2.7", "@uni-helper/vite-plugin-uni-components": "^0.0.9", "@uni-helper/vite-plugin-uni-layouts": "^0.1.7", "@uni-helper/vite-plugin-uni-manifest": "^0.2.3", "@uni-helper/vite-plugin-uni-pages": "^0.2.15", "@uni-helper/volar-service-uni-pages": "^0.2.15", "@unocss/eslint-config": "^0.59.0", "@unocss/eslint-plugin": "^0.59.0", "@vue/runtime-core": "^3.4.21", "@vue/tsconfig": "^0.5.1", "chalk": "^5.3.0", "compressing": "^1.10.0", "eslint": "^9.0.0", "eslint-plugin-format": "^0.1.0", "fs-extra": "^11.2.0", "husky": "^9.0.11", "lint-staged": "^15.2.2", "sass": "^1.74.1", "sass-loader": "^14.1.1", "simple-git-hooks": "^2.11.1", "typescript": "^5.4.4", "unocss": "^0.59.0", "unplugin-auto-import": "^0.17.5", "vite": "5.2.8", "vite-plugin-vconsole": "^2.1.1", "vue-tsc": "^2.0.11" },
系统信息
使用的包管理器
pnpm
核对