Skip to content

[transformer-compile-class] Updating class names during dev causes duplicate class name error #4926

Description

@mattmess1221

UnoCSS version

v66.5.1

Describe the bug

When using a pre-named compiled class via :uno-{name}: during dev mode, updating the class will cause a duplicated class name error.

[plugin:unocss:transformers:pre] Duplicated compile class name "uno-foo". One is "font-bold text-green text-lg" and the other is "font-bold text-lg". Please choose different class name or set 'alwaysHash' to 'true'.

Refreshing the page does not fix it and requires a full restart of the dev server.

Reproduction

https://stackblitz.com/edit/unocss-unocss-94wngyll?file=src%2FApp.vue

System Info

System: Windows 11/WSL
Browsers: Firefox
Framework: Nuxt/Vue

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions