1

When I switch project to angular universal, I get this error.

ERROR { Error: Uncaught (in promise): TypeError: Cannot read property 'parts/Chart.js' of undefined

I already wrapped chart based codes inside platform checking. But still face the issue.

if (isPlatformBrowser(this.platformId)) { 
    //....chart code 
}

Thank you :)

Mr.Bhat
  • 397
  • 5
  • 15
  • I am not sure how it is working in the `angular-highcharts`, but in the official `highcharts-angular` wrapper the simple assertion to make sure that you are not running highcharts on the server-side was enough to get rid of the errors. https://github.com/highcharts/highcharts-angular/issues/216 – Mateusz Kornecki Oct 15 '20 at 06:28
  • Thank you, but I I'm already checking if the platform is browser or server, and based on that its rendering. – Mr.Bhat Oct 15 '20 at 07:18
  • Could you reproduce the problem in an online editor or include a link to the repository so I can check if there is something we can fix? (unfortunately, I can help only with the `highcharts-angular` wrapper or just `highcharts` without any 3rd party products) – Mateusz Kornecki Oct 15 '20 at 08:45

0 Answers0