ui icon indicating copy to clipboard operation
ui copied to clipboard

use-toast build error on deployment

Open tanjunior opened this issue 1 year ago • 6 comments

Works fine on dev environment but failed to build in vercel

image

tanjunior avatar May 03 '23 09:05 tanjunior

This is related to an eslint error. Check the use-toast.ts file and change line: interface Toast extends Omit<ToasterToast, "id"> {} To type Toast = Omit<ToasterToast, "id">

@shadcn Do you think there is a reason to use interface? I was thinking maybe it would be an interesting idea to change all components to use type notation instead of interface notation when inheriting from other types without additional properties.

In case you are interested I can provide a PR for it later. Maybe would avoid ESlint issues like this for new users

dBianchii avatar May 03 '23 13:05 dBianchii

@shadcn Also, there is a comon ESLint rule called consistent-type-imports image image

I can also create dedicated PR in case it interests you to satisfy this eslint rule.

dBianchii avatar May 03 '23 13:05 dBianchii

@dBianchii I was afraid that changing it to type would break things so I did this for now. real janky but it works.

interface Toast extends Omit<ToasterToast, "id"> {
    never?: never
}

tanjunior avatar May 03 '23 13:05 tanjunior

@shadcn Also, there is a comon ESLint rule called consistent-type-imports image image

I can also create dedicated PR in case it interests you to satisfy this eslint rule.

I also made a PR for this https://github.com/shadcn/ui/pull/287

tanjunior avatar May 03 '23 14:05 tanjunior

@tanjunior I don't think changing it to type will break anything

dBianchii avatar May 03 '23 14:05 dBianchii

@tanjunior I don't think changing it to type will break anything

ok I will test it and update my PR if there is no issues.

tanjunior avatar May 03 '23 14:05 tanjunior