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 when using presetCatppuccin with UnoCSS #107

Open
Be1my opened this issue Nov 6, 2024 · 7 comments
Open

Type Error when using presetCatppuccin with UnoCSS #107

Be1my opened this issue Nov 6, 2024 · 7 comments
Assignees

Comments

@Be1my
Copy link

Be1my commented Nov 6, 2024

I am trying to use the presetCatppuccin with UnoCSS, but I am encountering the following TypeScript error:

Type 'Preset<object>' is not assignable to type 'PresetOrFactory<any> | PresetOrFactory<any>[]'. Type 'Preset<object>' is not assignable to type 'Preset<any>'. Types of property 'rules' are incompatible. Type 'Rule<object>[]' is not assignable to type 'Rule<any>[]'. Type 'Rule<object>' is not assignable to type 'Rule<any>'. Type 'DynamicRule<object>' is not assignable to type 'Rule<any>'. Type '[RegExp, DynamicMatcher<object>, RuleMeta?]' is not assignable to type 'StaticRule'. Type at position 0 in source is not compatible with type at position 0 in target. Type 'RegExp' is not assignable to type 'string'.

This issue started occurring recently after I updated my project, but everything was working fine a year ago when I last used this package. Although the project runs without issues, the TypeScript error is quite annoying.

@catuhana
Copy link
Owner

catuhana commented Nov 6, 2024

It seems like UnoCSS has updated some internal things? I'll fix this ASAP. In the meantime, you can use the UnoCSS version used by this library, which should be recent enough.

@catuhana catuhana added bug Something isn't working good first issue Good for newcomers labels Nov 6, 2024
@catuhana catuhana self-assigned this Nov 6, 2024
@catuhana
Copy link
Owner

catuhana commented Nov 6, 2024

It seems like it was already fixed with 03d530e, as I have no issues with local source. Will release v1.1.2 soon after bumping dependencies.

@catuhana catuhana removed bug Something isn't working good first issue Good for newcomers labels Nov 6, 2024
@catuhana
Copy link
Owner

catuhana commented Nov 6, 2024

v1.1.3 should be available in npm and JSR soon. Please let me know if it's not fixed or there are other issues.

@Be1my
Copy link
Author

Be1my commented Nov 7, 2024

Thank you for the update! I've tried v1.1.3, but the issue still seems to persist.

@catuhana
Copy link
Owner

catuhana commented Nov 7, 2024

Thank you for the update! I've tried v1.1.3, but the issue still seems to persist.

That seems weird, I can't reproduce it myself. Can you create a simple repository to reproduce, so I can test things?

@catuhana catuhana reopened this Nov 7, 2024
@Be1my
Copy link
Author

Be1my commented Nov 7, 2024

It seems to be a version issue in the package.json. The error disappeared when I updated unocss to v0.64.0.
unocss/unocss#1227 (comment)

@catuhana
Copy link
Owner

catuhana commented Nov 7, 2024

Ah, that makes sense. This issue (installed UnoCSS and library UnoCSS version not matching) would be warned about with #106 by the package managers itself.

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

2 participants