Skip to content

transformerAttributifyJsx caused vite Pre-transform error #4195

@xhanl

Description

@xhanl

UnoCSS version

0.63.4

Describe the bug

Running transformerAttributifyJsx with solid-sonner produces the following error:

[vite] Pre-transform error: /Users/_/Desktop/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/solid-sonner/dist/dev.jsx: Unexpected token, expected "," (440:58)

  438 |         return;
  439 |       }
> 440 |       toastRef?.style.setProperty("--swipe-amount", "0px=""");
      |                                                           ^
  441 |       setSwiping(false);
  442 |     }}
  443 |     onPointerMove={(event) => {

I checked solid-sonner/dist/dev.jsx, transformerAttributifyJsx may be converting this code

toastRef?.style.setProperty("--swipe-amount", "0px");

into

toastRef?.style.setProperty("--swipe-amount", "0px=""");

After uninstalling transformerAttributifyJsx, vite was successfully compiled.

Reproduction

https://stackblitz.com/edit/unocss-unocss-j46jgm?file=src%2FApp.tsx

System Info

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions