Grapecity activeReportJS taking more memory in angular that failed angular build command

120 Views Asked by At

I am using grapecity's activeReportJS with angular using it's native js library :

` deps :

.angular version : 15.1.1

node version : 16.15.0

@grapecity/activereports : ^4.0.2

`

Here I have paste some code through which I am loading report.rdlx-json file into viewer component.

` import { Viewer } from '@grapecity/activereports/reportviewer';

ngOnInit() {
    this.viewer = new Viewer('#viewer-host');
    this.viewer.toggleSidebar();
    this.viewer.toggleToolbar();
    this.viewer.availableExports = ['pdf'];
    this.viewer.renderMode = 'Galley';
    this.viewer.open(report.rdlx-json);
  }

`

above code is working fine while run the project, and when I run ng test command in local, my command also working fine.

But When my github's CICD pipeline execute and at that stage when this same command run, CI step getting failed and display error like this. :

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

If anyone have any solution for this library then please share it. It's really needed.

Note : I don't want to allocate more memory by using flag in command. it will eventually increase size and load time of my project.

Thank you

I tried many things like remove dependencies from angular.json

1

There are 1 best solutions below

1
On

ActiveReportsJS runs on the client-side (browser), which means that it is limited by the system and browser's performance.

The JavaScript heap out-of-memory error is thrown by the browser when the machine doesn't have enough RAM.

This means that if you are encountering an issue where the browser is running out of memory during build, then you will need to allocate more memory to the browser. This can be done by replacing the start script tag of the package.json with the following:

node --max_old_space_size=8192 ./node_modeuls/@angular/cli/bin/ng serve

If you are still experiencing issues, you can also feel free to create a ticket in our support system to get assistance from one of our engineers: https://www.grapecity.com/my-account/my-support