Is there way to fix below mentioned error in angular 17 (ssr enabled)?

35 views Asked by At

Tried to build angular 17 project but encountered error:

cannot read properties of undefined (reading 'Core/Utilities.js') which is preventing from building the project.

I used command npx ng build --configuration production to build the project

Build issue image with angular  version details

1

There are 1 answers

0
Matthieu Riegler On

Highcharts doesn't support SSR.

You have to make it run client side only: This is what the docs recommends:

export class AppComponent {
  isHighcharts = typeof Highcharts === 'object';
  Highcharts: typeof Highcharts = Highcharts;
  chartOptions: Highcharts.Options = {...};
}
<highcharts-chart
  *ngIf="isHighcharts"
  [Highcharts]="Highcharts"
  [options]="chartOptions"
></highcharts-chart>