You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shopify/app-bridge-react conflicting with shadcn UI Type 'string' is not assignable to type 'null | undefined
#8434
This error occurs because @shopify/app-bridge-react extends/pollutes the global JSX HTMLButtonElement attributes with its own custom variant prop type definition (which expects null | undefined or Shopify-specific variant tokens), conflicting with CVA's (class-variance-authority) VariantProps<typeof buttonVariants>.
The Solution: Omit variant from ButtonProps
Open your components/ui/button.tsx and explicitly omit variant from React.ButtonHTMLAttributes<HTMLButtonElement> before intersecting with VariantProps:
By wrapping React.ButtonHTMLAttributes<HTMLButtonElement> in Omit<..., "variant">, you strip the global variant property definition injected by @shopify/app-bridge-react, allowing CVA's type-safe variant variants (default, destructive, outline, secondary, ghost, link) to take full control without any type collisions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have
@shopify/app-bridge-react": "^4.2.7installed with shadcn and somehow it's conflicting withvariantprop not sure whyAll reactions