-
-
Notifications
You must be signed in to change notification settings - Fork 956
Closed
Description
UnoCSS version
66.5.12
Describe the bug
I came accross the type error on vitest-dev/vitest#9192 and it appears there is inherent duplicate or inconsistent types within unocss package.
import { presetMini } from 'unocss';
import Unocss from 'unocss/vite';
Unocss({
presets: [presetMini()],
});❯ tsc -b
repro.ts:5:13 - error TS2322: Type 'Preset<Theme$1>' is not assignable to type 'PresetOrFactoryAwaitable<Theme$1> | PresetOrFactoryAwaitable<Theme$1>[]'.
Type 'import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").Pn<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>' is not assignable to type 'Preset<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>'.
Types of property 'rules' are incompatible.
Type 'import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").Gn<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>[] | undefined' is not assignable to type 'Rule<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>[] | undefined'.
Type 'import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").Gn<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>[]' is not assignable to type 'Rule<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>[]'.
Type 'import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").Gn<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>' is not assignable to type 'Rule<import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").xt>'.
Type 'StaticRule' is not assignable to type 'Rule<Theme$1>'.
Type '[string, CSSObject | CSSEntries | (string | CSSValueInput)[], (RuleMeta | undefined)?]' is not assignable to type 'StaticRule'.
Type at position 1 in source is not compatible with type at position 1 in target.
Type 'import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").Qt | import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").Yt | (string | import("/home/projects/vitejs-vite-hhrsjwej/node_modules/unocss/dist/index-XUBLdNw_").tn)[]' is not assignable to type 'CSSObject | CSSEntries | (string | CSSValueInput)[]'.
Type '(string | CSSValueInput)[]' is not assignable to type 'CSSObject | CSSEntries | (string | CSSValueInput)[]'.
Type '(string | CSSValueInput)[]' is not assignable to type 'CSSEntries'.
Type 'string | CSSValueInput' is not assignable to type 'CSSEntry'.
Type 'string' is not assignable to type '[string, string | number | undefined, (Arrayable<string> | undefined)?]'.
5 presets: [presetMini()],
~~~~~~~~~~~~
Found 1 error.Reproduction
System Info
stackblitz
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
No labels