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
Describe the bug
I am creating a component library for internal org use. For this I have a few components that use cva but when consuming these components in applications, the types from VariantProps are not reflected. Interestingly, the types work perfectly when consuming the component directly in storybook within the lib.
What I suspect is happening here is that typescript is not taking the exports field for "./types" in package.json into account because manually editing the .d.ts file as below seems to work:
Describe the bug
I am creating a component library for internal org use. For this I have a few components that use cva but when consuming these components in applications, the types from VariantProps are not reflected. Interestingly, the types work perfectly when consuming the component directly in storybook within the lib.
Here is a sample component:
And, here is the declaration file output by tsc:
What I suspect is happening here is that typescript is not taking the exports field for "./types" in package.json into account because manually editing the .d.ts file as below seems to work:
So using
import("class-variance-authority/types").ClassProp
instead ofimport("class-variance-authority/dist/types").ClassProp
package.json:
cva/packages/class-variance-authority/package.json
Lines 29 to 31 in a1f7f50
Is there anything I can do to resolve this?
The text was updated successfully, but these errors were encountered: