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

Production builds of Rancher Components fails #13211

Open
rak-phillip opened this issue Jan 26, 2025 · 0 comments
Open

Production builds of Rancher Components fails #13211

rak-phillip opened this issue Jan 26, 2025 · 0 comments
Labels
QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this research-needed Label for design issue that requires more technical research than what is in the issue description status/dev-validate

Comments

@rak-phillip
Copy link
Member

Production builds of Rancher Components fail when attempting to infer the type of a component via export type RcButtonType = InstanceType<typeof RcButton>. This technique works in development builds and for in-editor hints, yet fails when running the yarn build:lib command.

TS2344: Type '{}' does not satisfy the constraint 'abstract new (...args: any) => any'.
  Type '{}' provides no match for the signature 'new (...args: any): any'.
    1 | import { RcButton } from "@components/RcButton";
    2 |
  > 3 | export type RcButtonType = InstanceType<typeof RcButton>
      |                                         ^^^^^^^^^^^^^^^
    4 |
    5 | export type ButtonRoleProps = {
    6 |   primary?: boolean;

 ERROR  Error: Build failed with errors.

Notes

Using InstanceType<typeof RcButton> allows for typescript to properly infer the types of Vue components, this is especially useful when using the composition api in components that utilize defineExpose

@rak-phillip rak-phillip added research-needed Label for design issue that requires more technical research than what is in the issue description status/dev-validate labels Jan 26, 2025
@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this research-needed Label for design issue that requires more technical research than what is in the issue description status/dev-validate
Projects
None yet
Development

No branches or pull requests

1 participant