Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error occurred when preset was specified for unocss #84

Open
makotot opened this issue Sep 19, 2022 · 0 comments
Open

Type error occurred when preset was specified for unocss #84

makotot opened this issue Sep 19, 2022 · 0 comments

Comments

@makotot
Copy link

makotot commented Sep 19, 2022

presetUno() will result in a type error, but it does not appear from the README that any options are required.
Am I using it wrong?

❯ deno check main.tsx
Check file://path/to/project/main.tsx
error: TS2322 [ERROR]: Type 'Preset<Theme>' is not assignable to type 'Preset<{}> | Preset<{}>[]'.
  Type 'Preset<Theme>' is not assignable to type 'Preset<{}>'.
    Types of property 'rules' are incompatible.
      Type 'Rule<Theme>[] | undefined' is not assignable to type 'Rule<{}>[] | undefined'.
        Type 'Rule<Theme>[]' is not assignable to type 'Rule<{}>[]'.
          Type 'Rule<Theme>' is not assignable to type 'Rule<{}>'.
            Type '[RegExp, DynamicMatcher<Theme>]' is not assignable to type 'Rule<{}>'.
              Type '[RegExp, DynamicMatcher<Theme>]' 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'.
      presetUno(),

My main.tsx is like this.

/** @jsx h */

import blog from "https://deno.land/x/[email protected]/blog.tsx";
import presetUno from 'https://esm.sh/@unocss/[email protected]'

blog({
  ...,
  unocss: {
    presets: [
      presetUno(),
    ],
  },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant