Skip to content

Several TypeScript errors #569

@jgosmann

Description

@jgosmann

Expected behaviour

TypeScript compiler doesn't report any errors.

Actual behaviour

TypeScript compiler reports several errors:

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/index.d.ts:14:15 - error TS2306: File 'node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/indicators/index.d.ts' is not a module.

14 export * from "./indicators/index.js";
                 ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/Legend.d.ts:74:59 - error TS2304: Cannot find name 'Point'.

74     labelFormatter?: Highcharts.FormatterCallbackFunction<Point | Series>;
                                                             ~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/Legend.d.ts:74:67 - error TS2304: Cannot find name 'Series'.

74     labelFormatter?: Highcharts.FormatterCallbackFunction<Point | Series>;
                                                                     ~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/PlotOptions.d.ts:59:27 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

59             units?: Array<Array<string, Array<number> | null>>;
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/PlotOptions.d.ts:164:62 - error TS2304: Cannot find name 'Series'.

164             formatter?: Highcharts.FormatterCallbackFunction<Series>;
                                                                 ~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/PlotOptions.d.ts:225:39 - error TS2724: '"node_modules/.pnpm/highcharts@12.5.0/node_modules/highcharts/highcharts"' has no exported member named 'PlotSeriesOptions'. Did you mean 'SeriesOptions'?

225         navigatorOptions?: Highcharts.PlotSeriesOptions;
                                          ~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/XAxis.d.ts:270:19 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

270     units?: Array<Array<string, Array<number> | null>>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/YAxis.d.ts:165:19 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

165     stops?: Array<Array<number, Highcharts.ColorType>>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/YAxis.d.ts:321:19 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

321     units?: Array<Array<string, Array<number> | null>>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 9 errors in 5 files.

Errors  Files
     1  node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/index.d.ts:14
     2  node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/Legend.d.ts:74
     3  node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/PlotOptions.d.ts:59
     1  node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/XAxis.d.ts:270
     2  node_modules/.pnpm/@highcharts+react@4.2.1_@types+react@19.2.14_highcharts@12.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@highcharts/react/options/YAxis.d.ts:165

Live demo with steps to reproduce

  1. pnpm init
  2. pnpm add @highcharts/react react
  3. pnpm add -D @types/react typescript
  4. Create index.ts with:
    # index.ts
    import React from "react"
    import { Chart } from "@highcharts/react"
  5. pnpm exec tsc index.ts

Product version

  • @highcharts/react 4.2.1
  • react 19.2.4
  • @types/react 19.2.14
  • typescript 6.0.2

Affected browser(s)

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions