GithubHelp home page GithubHelp logo

Comments (6)

bre1470 avatar bre1470 commented on June 23, 2024 1

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 .

from highcharts.

rbirkgit avatar rbirkgit commented on June 23, 2024

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 = {
                                                          ~~~~~~~~~~~~~~~~



from highcharts.

rbirkgit avatar rbirkgit commented on June 23, 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.

from highcharts.

bre1470 avatar bre1470 commented on June 23, 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.

from highcharts.

rbirkgit avatar rbirkgit commented on June 23, 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.

from highcharts.

rbirkgit avatar rbirkgit commented on June 23, 2024

I should be all set. Thanks for quick help!

from highcharts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.