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

Namespace 'Highcharts' has no exported member 'ChartCallbackFunction'. Does the current version support angular 5 #107

Closed
elninotorres opened this issue Dec 29, 2018 · 23 comments

Comments

@elninotorres
Copy link

elninotorres commented Dec 29, 2018

I am currently using angular 5.2.0.
I imported the modules as per the file, and i am not able to serve my application due to an error
ERROR in ../node_modules/highcharts-angular/lib/highcharts-chart.component.d.ts(8,34): error TS2694: Namespace 'Highcharts' has no exported member 'ChartCallbackFunction'.

@KacperMadej
Copy link
Contributor

Hi @elninotorres

Thank you for reporting about the problem.

Please check and provide info about: used Highcharts version, used TypeScript type definitions (official provided with Highcharts 7+, official beta definitions for Highcharts 6, legacy definitions from definitely typed, or other).

Please create a live demo or provide another way to recreate the problem.

Current version of Highcharts (7.0.1) has that member exported as you could check here.

P.S. I have edited your comments - because you have ignored the bug report template there's no reason for it to leave it.

@doublemcz
Copy link

@elninotorres Can you share your package.json? I had the same behaviour until I found out I installed the bad package 'angular-highcharts' next to 'highcharts-angular' :-D After reinstalling from scratch everything is good.

@elninotorres
Copy link
Author

My issue was that i have "@types/highcharts" installed "^5.0.36",
But i had to install it to solve another error --error TS2688: Cannot find type definition file for 'highcharts'.

@KacperMadej
Copy link
Contributor

Without a way to recreate the problem I can only try to guess what might be wrong.
Please check Highcharts version used and see the other issue #109 for details.
I hope both issues will turn out to be the same one.
Please let me know why have you installed "@types/highcharts"? Is there anything in docs or out there in the Internet suggesting to do so?

@infosec-au
Copy link

I was able to fix this bug by locking my package.json with the following versions:

"highcharts-angular": "2.1.3",
"@types/highcharts": "5.0.27"

If you don't need to update highcharts, this could be a solution for you. After locking these versions, we were able to compile our Angular application without errors.

@KacperMadej
Copy link
Contributor

@infosec-au

Thank you for sharing your solution. This way of loading TS types is not advised for Highcharts v6 and above, but please provide details if possible:

  • "don't need to update Highcharts", so what version are you using?
  • what's Angular version used in case of your project? (5.2.0 ?)

@elninotorres
Copy link
Author

I am using angular version 5.2.0.
Is it possible to use latest highcharts version with this version, also in your docs you have mentioned angular cli 6+, so will that be a problem if i use angular version 5.
I had this error https://stackoverflow.com/questions/48222335/cannot-find-type-definition-file-for-highcharts. That is why i used types/highcharts. These are my highcharts versions
"highcharts": "^6.2.0",
"highcharts-angular": "^2.4.0",

@KacperMadej
Copy link
Contributor

The highcharts-angular wrapper should work with Angular 2+, but new versions of Angular are used for tests, so in case there's a problem we need to know what versions of Agnular, TS, and Highcharts are used.

Major update was made for the wrapper when adapting to Angular v6 - this is the reason of the docs version specification.

Highcharts version TS definitions
< v6 need @types/highcharts
v6 official beta
v7 provided with Highcharts

More info here: DefinitelyTyped/DefinitelyTyped#22893

@yelf06
Copy link

yelf06 commented Jan 14, 2019

Hi,

I have the same exact problem described.

Used versions :

"@angular/core": "^7.1.4"
"highcharts": "^6.2.0"
"highcharts-angular": "^2.1.3"
"@types/highcharts": "^5.0.27",
"typescript": "~3.1.6"

@KacperMadej
Copy link
Contributor

Hi @yelf06

Highcharts version under 7 might not have complete TS definitions - you could check files from the table in my last comment to be sure. The last version of the wrapper is up to date with the Highcharts, so it's expected to use version 7 or newer of Highcharts. If you want to use older version of Highcharts please use older version of the wrapper - e.g. 2.3.1 or load Highcharts v7+ to supply proper TS definitions for the wrapper as it expects those definitions to be loaded with Highcharts.

@yelf06
Copy link

yelf06 commented Jan 15, 2019

Hi @KacperMadej

Thank you for your response. Let suppose I use highcharts 7, could you please provide an example of the dependencies I should use and their versions. I don't think I understood your message correctly.

Thank you

@KacperMadej
Copy link
Contributor

@yelf06 Sure, here's the case:

Using Highcharts v7 - TS definitions are provided with the library, so do not load @types/highcharts. Only the Highcharts lib. Here's more info for this case: https://www.highcharts.com/docs/advanced-chart-features/typescript

Please let me know if anything is unclear and I will try to provide better or more info.

@yelf06
Copy link

yelf06 commented Jan 16, 2019

Hi @KacperMadej ,

Thank you for your help.

It was a simple as adding this in the ts file :

import * as Highcharts from "highcharts/highstock";
import * as HighchartsMore from "highcharts/highcharts-more";
HighchartsMore(Highcharts);

In the html :

<highcharts-chart [Highcharts]="Highcharts"
                                  [options]="chartOptions">
</highcharts-chart>

Thank you again

@aravind-ui
Copy link

aravind-ui commented Feb 22, 2019

Hi @KacperMadej ,,
Me too getting the same error

ERROR in node_modules/highcharts-angular/lib/highcharts-chart.component.d.ts(8,34): error TS2694: Namespace 'Highcharts' has no exported member 'ChartCallbackFunction'.

@KacperMadej
Copy link
Contributor

@aravind-ui
The same error, so my comment is the same: #107 (comment)

@aravind-ui
Copy link

aravind-ui commented Feb 22, 2019

hi @KacperMadej,

used versions,

"highcharts": "^6.2.0",
"highcharts-angular": "^2.3.1",
"@types/highcharts": "^5.0.36",

"@angular/core": "^7.2.3",
"@angular/cli": "~6.0.8",
"typescript": "~3.2.4"

@KacperMadej
Copy link
Contributor

@aravind-ui

Please use beta declarations instead of the @types/highcharts - https://github.com/highcharts/highcharts-declarations-beta/

As explained in the table here: #107 (comment)

@KacperMadej
Copy link
Contributor

Closing due to inactivity.
Please leave a comment with relevant info if you would like to see this issue reopened.

@drenmullafetahu
Copy link

Hello I still have this problem and can't fix it ? can someone help

@KacperMadej
Copy link
Contributor

Hi @drenmullafetahu

If you have the same problem then you should fix it as instructed in the comments above.
If you are unable to do so, then you could provide more relevant info.
If you have a different problem you could open a new issue or better yet - contact technical support first to know if the problem you have is a bug or not.
https://www.highcharts.com/blog/support/

andy7i added a commit to all-of-us/workbench that referenced this issue Nov 27, 2019
yarn upgrade angular2-highcharts
yarn upgrade angular2-highcharts --latest
// the sub-dependency has not changed.
yarnpkg/yarn#2394

yarn remove angular2-highcharts
yarn add angular2-highcharts

after all that.... still nothing:
dependencies:
  "@types/highcharts" "^4.2.47"
  highcharts "^5.0.7"

`yarn dev-up` now fails

in highcharts/highcharts-angular#107
someone mentioned that setting the version # fixed the issue. Reverted the version number to 2.0.0:

`yarn add highcharts-react-official@2.0.0`
@dositejg
Copy link

If you're using angular-highcharts version 7 or above, makes sure to remove @types/highcharts dependency, it worked for me.

@puneetnamdev
Copy link

puneetnamdev commented Dec 25, 2021

Hi, I am using Angular 11 having this issues. connect with support team on Skypee but did't find any solution. This version working fine "highcharts": "^9.0.1", . But latest version not working.

Also remove @types/highcharts

As recommended by Highchart support team
"highcharts": "^9.3.2",
"highcharts-angular": "^3.0.0",

H1

@karolkolodziej
Copy link
Contributor

For now, for Angular 11/12 please use the 2.10.0 version of highcharts-angular
More on that here: #307

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

10 participants