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

Highcharts.SeriesPieOptions is missing with 11.4.1 #20986

Closed
rbirkgit opened this issue Apr 10, 2024 · 6 comments
Closed

Highcharts.SeriesPieOptions is missing with 11.4.1 #20986

rbirkgit opened this issue Apr 10, 2024 · 6 comments

Comments

@rbirkgit
Copy link

Expected behaviour

No error building

Actual behaviour

We updated HIghcharts from 11.4.0 to 11.4.1 and with that we started getting error that Highcharts.SeriesPieOptions is not defined.

Live demo with steps to reproduce

This is how we import Highcharts with 11.4.0

import Highcharts from 'highcharts/es-modules/masters/highcharts.src';

Product version

11.4.1

Affected browser(s)

@rbirkgit
Copy link
Author

We get error on compile, so it's not an editor issue.

All we have is this import (to use ESM)

import Highcharts from 'highcharts/es-modules/masters/highcharts.src';

Then in our code:

export const DONUT_CHART_SERIES_BASE: Highcharts.SeriesPieOptions = {
  type: 'pie',
  data: []
};

This is the error:

Error: apps/accounts-and-resources/src/app/accounts-and-resources/highcharts.constants.ts:52:50 - error TS2724: '"D:/Git/cloud-ui/node_modules/highcharts/highcharts"' has no exported member named 'SeriesPieOptions'. Did you mean 'SeriesOptions'?

      52 export const DONUT_CHART_SERIES_BASE: Highcharts.SeriesPieOptions = {
                                                          ~~~~~~~~~~~~~~~~



@rbirkgit
Copy link
Author

rbirkgit commented Apr 10, 2024

I can add this to our code:

type SeriesPieOptions = Highcharts.SeriesOptionsRegistry['SeriesPieOptions'];

Then use this new type alias instead:

export const DONUT_CHART_SERIES_BASE: SeriesPieOptions = {
  type: 'pie',
  data: []
};

This compiles but seems like a workaround and not proper way of doing it? Just want to confirm it.

@bre1470
Copy link
Contributor

bre1470 commented Apr 10, 2024

Hello @rbirkgit,

Thank you for the details. I need more information to have a chance of reproducing the issue.

Please provide the content of all tsconfig.json, the building command, and additional configuration files related to it.

You can also take a look at this working project https://github.com/bre1470/testproject-es6 and compare it with your configuration.

@rbirkgit
Copy link
Author

rbirkgit commented Apr 10, 2024

Thanks for the short sample. It all works fine there (adding our code). I now see what is going on.

Our code imported Highcharts in the main file. Then imported data from a model file. That model file didn't import Highcharts itself. It somehow worked anyway for the code and types including other series. But not the SeriesPieOptions . Go figure.

Adding the import of Highcharts at the top of the model file, the code compiles now without workarounds.

@rbirkgit
Copy link
Author

I should be all set. Thanks for quick help!

@bre1470
Copy link
Contributor

bre1470 commented Apr 10, 2024

Thank you for sharing your solution. Wonderful that it works now. I will close the issue as solved. Feel free to comment further if needed.

Internal: FYI @hubertkozik .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants