Skip to content

Conversation

yadhukrishnasm
Copy link

Problem

VariantProps is currently imported as a value:

import { cva, VariantProps } from "class-variance-authority"

This causes a TypeScript error when verbatimModuleSyntax is enabled:

'VariantProps' is a type and must be imported using a type-only import

Solution

Import VariantProps as a type:

import { cva, type VariantProps } from "class-variance-authority"

Why

This resolves type errors in projects using TS 5.x strict module settings while preserving behavior in earlier TS versions.

Currently, VariantProps is imported as a value:

  import { cva, VariantProps } from "class-variance-authority"

This causes a TypeScript error when `verbatimModuleSyntax` is enabled:

  'VariantProps' is a type and must be imported using a type-only import

Since VariantProps is a type, it should be imported with `import type`:

  import { cva, type VariantProps } from "class-variance-authority"

This fixes the type error in projects using TS 5.x strict module settings.
fix: import VariantProps as a type-only import
Copy link

vercel bot commented Sep 4, 2025

@yadhukrishnasm is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant