Skip to content

Type errors on v37+ #3053

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

Open
2 tasks done
yingz1985 opened this issue Mar 27, 2025 · 0 comments
Open
2 tasks done

Type errors on v37+ #3053

yingz1985 opened this issue Mar 27, 2025 · 0 comments
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@yingz1985
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Victory version

37.0.2, 37.3.6

Code Sandbox link

No response

Bug report

Upgraded victory from v36 to v37 and Typescript build no longer succeeds 

../../node_modules/victory-area/lib/victory-area.d.ts:76:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

76         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-axis/lib/victory-axis.d.ts:284:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

284         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-bar/lib/victory-bar.d.ts:116:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

116         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-box-plot/lib/victory-box-plot.d.ts:126:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

126         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-candlestick/lib/victory-candlestick.d.ts:114:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

114         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:8:106 - error TS2344: Type 'TContainerComponents[TContainerA]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.
  Type 'TContainerComponents["cursor"] | TContainerComponents["zoom"] | TContainerComponents["voronoi"] | ... 6 more ... | TContainerComponents["brush" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.
    Type 'TContainerComponents["cursor" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.

8     (props: TContainerA extends ContainerType ? TContainerB extends ContainerType ? React.ComponentProps<TContainerComponents[TContainerA]> & React.ComponentProps<TContainerComponents[TContainerB]> : TContainerA & TContainerB : TContainerA & TContainerB): JSX.Element;
                                                                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:8:164 - error TS2344: Type 'TContainerComponents[TContainerB]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.
  Type 'TContainerComponents["cursor"] | TContainerComponents["zoom"] | TContainerComponents["voronoi"] | ... 6 more ... | TContainerComponents["brush" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.
    Type 'TContainerComponents["cursor" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.

8     (props: TContainerA extends ContainerType ? TContainerB extends ContainerType ? React.ComponentProps<TContainerComponents[TContainerA]> & React.ComponentProps<TContainerComponents[TContainerB]> : TContainerA & TContainerB : TContainerA & TContainerB): JSX.Element;
                                                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:11:119 - error TS2344: Type 'TContainerComponents[TContainerA]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.
  Type 'TContainerComponents["cursor"] | TContainerComponents["zoom"] | TContainerComponents["voronoi"] | ... 6 more ... | TContainerComponents["brush" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.
    Type 'TContainerComponents["cursor" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.

11     defaultEvents(props: TContainerA extends ContainerType ? TContainerB extends ContainerType ? React.ComponentProps<TContainerComponents[TContainerA]> & React.ComponentProps<TContainerComponents[TContainerB]> : TContainerA & TContainerB : TContainerA & TContainerB): ({
                                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:11:177 - error TS2344: Type 'TContainerComponents[TContainerB]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.
  Type 'TContainerComponents["cursor"] | TContainerComponents["zoom"] | TContainerComponents["voronoi"] | ... 6 more ... | TContainerComponents["brush" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.
    Type 'TContainerComponents["cursor" & VictoryContainerProps]' is not assignable to type 'keyof IntrinsicElements | JSXElementConstructor<any>'.

11     defaultEvents(props: TContainerA extends ContainerType ? TContainerB extends ContainerType ? React.ComponentProps<TContainerComponents[TContainerA]> & React.ComponentProps<TContainerComponents[TContainerB]> : TContainerA & TContainerB : TContainerA & TContainerB): ({
                                                                                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:17:106 - error TS2344: Type '{ zoom: { (initialProps: VictoryZoomContainerProps): Element; role: string; defaultEvents(initialProps: VictoryZoomContainerProps): { ...; }[]; }; selection: { ...; }; brush: { ...; }; cursor: { ...; }; voronoi: { ...; }; }[TContainerA]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.

 17     (props: TContainerA extends ContainerType ? TContainerB extends ContainerType ? React.ComponentProps<{
                                                                                                             ~
 18         zoom: {
    ~~~~~~~~~~~~~~~
...
110         };
    ~~~~~~~~~~
111     }[TContainerA]> & React.ComponentProps<{
    ~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:111:44 - error TS2344: Type '{ zoom: { (initialProps: VictoryZoomContainerProps): Element; role: string; defaultEvents(initialProps: VictoryZoomContainerProps): { ...; }[]; }; selection: { ...; }; brush: { ...; }; cursor: { ...; }; voronoi: { ...; }; }[TContainerB]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.

111     }[TContainerA]> & React.ComponentProps<{
                                               ~
112         zoom: {
    ~~~~~~~~~~~~~~~
...
204         };
    ~~~~~~~~~~
205     }[TContainerB]> : TContainerA & TContainerB : TContainerA & TContainerB): JSX.Element;
    ~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:208:119 - error TS2344: Type '{ zoom: { (initialProps: VictoryZoomContainerProps): Element; role: string; defaultEvents(initialProps: VictoryZoomContainerProps): { ...; }[]; }; selection: { ...; }; brush: { ...; }; cursor: { ...; }; voronoi: { ...; }; }[TContainerA]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.

208     defaultEvents(props: TContainerA extends ContainerType ? TContainerB extends ContainerType ? React.ComponentProps<{
                                                                                                                          ~
209         zoom: {
    ~~~~~~~~~~~~~~~
...
301         };
    ~~~~~~~~~~
302     }[TContainerA]> & React.ComponentProps<{
    ~~~~~~~~~~~~~~~~~~

../../node_modules/victory-create-container/lib/create-container.d.ts:302:44 - error TS2344: Type '{ zoom: { (initialProps: VictoryZoomContainerProps): Element; role: string; defaultEvents(initialProps: VictoryZoomContainerProps): { ...; }[]; }; selection: { ...; }; brush: { ...; }; cursor: { ...; }; voronoi: { ...; }; }[TContainerB]' does not satisfy the constraint 'keyof IntrinsicElements | JSXElementConstructor<any>'.

302     }[TContainerA]> & React.ComponentProps<{
                                               ~
303         zoom: {
    ~~~~~~~~~~~~~~~
...
395         };
    ~~~~~~~~~~
396     }[TContainerB]> : TContainerA & TContainerB : TContainerA & TContainerB): ({
    ~~~~~~~~~~~~~~~~~~

../../node_modules/victory-errorbar/lib/victory-errorbar.d.ts:72:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

72         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-histogram/lib/victory-histogram.d.ts:118:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

118         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-legend/lib/victory-legend.d.ts:100:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

100         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-line/lib/victory-line.d.ts:66:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

66         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-pie/lib/victory-pie.d.ts:101:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

101         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-polar-axis/lib/victory-polar-axis.d.ts:94:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

94         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-scatter/lib/victory-scatter.d.ts:83:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

83         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/victory-voronoi/lib/victory-voronoi.d.ts:73:39 - error TS2307: Cannot find module '@/victory-core/lib/victory-util/events' or its corresponding type declarations.

73         componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 21 errors in 14 files.

Steps to reproduce

Steps to reproduce:
Install victory v37+ on a repository using Typescript 5.5+
import any victory charts, and try to build the package
errors thrown for `componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;` across many d..ts files

Expected behavior

No TS errors

Actual behavior

Environment

- Device:Desktop
- OS:Windows
- Node:v22
@yingz1985 yingz1985 added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

No branches or pull requests

1 participant