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

CLI: shadcn-svelte@latest update utils returns TS in JS mode #981

Closed
Extarys opened this issue Apr 2, 2024 · 3 comments · Fixed by #982
Closed

CLI: shadcn-svelte@latest update utils returns TS in JS mode #981

Extarys opened this issue Apr 2, 2024 · 3 comments · Fixed by #982
Labels
type: bug A confirmed report of unexpected behavior in the application type: CLI

Comments

@Extarys
Copy link

Extarys commented Apr 2, 2024

Describe the bug

I've opted out of typescript when installing shadcn-svelte. After updating to 0.10, I get the following error:

Expected ',', got 'ClassValue'

This is coming from utils.js:

import { type ClassValue, clsx } from "clsx";
                   ^
                   |-- Error
import { twMerge } from "tailwind-merge";
import { cubicOut } from "svelte/easing";
import type { TransitionConfig } from "svelte/transition";

export function cn(...inputs: ClassValue[]) {
                                ^
                                |-- Error
	return twMerge(clsx(inputs));
}

type FlyAndScaleParams = {
	y?: number;
	x?: number;
	start?: number;
	duration?: number;
};

Reproduction

  1. Install a version older than 0.10
  2. Opt-out of Typescript
  3. Update to 0.10
  4. Get error

I've also tried updated my packages with bun update, but I have the same error as before.

Logs

No response

System Info

System:
    OS: Linux 6.7 Fedora Linux 39 (KDE Plasma)
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 47.78 GB / 62.68 GB
    Container: Yes
    Shell: 5.2.26 - /bin/bash
  Binaries:
    Node: 20.10.0 - /usr/bin/node
    Yarn: 1.22.21 - /usr/bin/yarn
    npm: 10.2.3 - /usr/bin/npm
    bun: 1.0.17 - ~/.bun/bin/bun
  npmPackages:
    @sveltejs/kit: ^2.0.0 => 2.5.5 
    bits-ui: ^0.21.1 => 0.21.1 
    cmdk-sv: ^0.0.17 => 0.0.17 
    formsnap: ^1.0.0 => 1.0.0 
    lucide-svelte: ^0.364.0 => 0.364.0 
    mode-watcher: ^0.3.0 => 0.3.0 
    svelte: ^5.0.0-next.1 => 5.0.0-next.90 
    svelte-sonner: ^0.3.21 => 0.3.21

Severity

blocking all usage of shadcn-svelte

@AdrianGonz97 AdrianGonz97 changed the title Expected ',', got 'ClassValue' after update to 0.10 w/ Javascript CLI: shadcn-svelte@latest update utils returns TS in JS mode Apr 2, 2024
@AdrianGonz97
Copy link
Collaborator

thank you for the detailed reproduction. looking into this now!

@AdrianGonz97 AdrianGonz97 added type: bug A confirmed report of unexpected behavior in the application type: CLI labels Apr 2, 2024
@AdrianGonz97
Copy link
Collaborator

Should be fixed now in [email protected]

@Extarys
Copy link
Author

Extarys commented Apr 2, 2024

Thanks ! Fastest fix ever !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A confirmed report of unexpected behavior in the application type: CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants