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

Duplicate compile class name when use @unocss/transformer-compile-class #2667

Closed
4 tasks done
nguyentuevuong opened this issue May 24, 2023 · 3 comments
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@nguyentuevuong
Copy link

nguyentuevuong commented May 24, 2023

UnoCSS version

0.52.3

Describe the bug

When using the uno 0.52.3 version, if you use the transformer class with a non-default classPrefix configuration for vite and vuejs, you will encounter the error shown in the image below:

image

How to use:
image

uno.config.ts configuration file:

import {
  defineConfig, 
  presetUno, 
  transformerCompileClass,
} from 'unocss';

export default defineConfig({
  presets: [
    presetUno(),
  ],
  include: /(vue|ts|html)/,
  exclude: /(node_modules)/,
  transformers: [
    transformerCompileClass({
     // This configuration is causing an error.
      classPrefix: 'ui-',
    }),
  ],
});

Reproduction

StackBlitz sample:
https://stackblitz.com/edit/vitejs-vite-r1w7qg?file=uno.config.ts

System Info

No response

Validations

@dycops
Copy link

dycops commented May 30, 2023

Have a solution?

@nguyentuevuong
Copy link
Author

Have a solution?

You can temporarily use the solution I implemented in this PR #2664, as the described issues have been resolved by me. However, the PR has not been approved yet.

@jacob-8
Copy link
Contributor

jacob-8 commented May 31, 2023

if you use the transformer class with a non-default classPrefix

This error is also showing up with the default :uno: prefix as seen here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants