Assistance Required: "Maximum Call Stack Size Exceeded

Posted by: syed.tahir on 26 November 2024, 8:20 pm EST

    • Post Options:
    • Link

    Posted 26 November 2024, 8:20 pm EST - Updated 26 November 2024, 8:21 pm EST

    Error When Generating PDF Reports in Node.js with ActiveReportsJS

    Dear ActiveReportsJS Support Team,

    I am encountering an issue when generating PDF reports using ActiveReportsJS in a Node.js environment. Specifically, I receive a “Maximum call stack size exceeded” error during the PDF generation process. However, when running the report viewer within a React application, the report renders and generates the PDF without any issues.

    **Steps to Reproduce:

    **1/ Install Dependencies:

    • Run
      npm install
      to install all necessary packages.
    • Install Playwright by executing
      npx playwright install
      .

    2/ Initialize the Application:

    Execute

    node .\init.js
    to set up the application.

    **3/ Generate the Report:

    • Make a POST request to the Node.js service responsible for generating the report.

    Observations:

    The error occurs exclusively during the PDF generation phase in the Node.js environment.

    The same report renders and generates the PDF correctly when using the React application.

    Request for Assistance:

    Could you please provide guidance on the following:

    1/ Potential causes of the “Maximum call stack size exceeded” error during PDF generation in Node.js.

    2/ Recommended solutions or workarounds to resolve this issue.

    3/ Any specific configurations or settings required for PDF generation in a Node.js environment using ActiveReportsJS.

    I have attached the relevant code snippets and configuration files for your reference. Your assistance in resolving this issue would be greatly appreciated.

    Thank you for your support.

    Best regards,active-reportjs-demo 1.zip

  • Posted 27 November 2024, 5:12 am EST

    Hi Tahir,

    Thank you for the detailed explanation of the issue and the necessary attachments. We could replicate the issue at our end as well and have escalated the same to our development team for their insights [Internal tracking ID: ARJ-6494]. We will get back to you as soon as we get any updates from their side. Thanks for your patience in the meantime.

  • Posted 28 November 2024, 12:53 am EST

    Hi @katyayny,

    could you please give us the EAT when will this item be solved, and any link that I can check status of this issue as this issue is on priority for us.

  • Posted 28 November 2024, 2:38 am EST

    Hi Tahir,

    It seems that the issue is not related to the report or ARJS. You have used

    String.fromCharCode.apply
    to convert binary data to a Base64 string, which didn’t work well for large amounts of data. The issue was resolved at my end by using a FileReader to convert the binary data to Base64. Please see the updated sample demonstrating the same.

    We hope this helps!

    Attachment: https://drive.mescius.io/download?file=ExternalShare/PDFExportSample.zip

  • Posted 2 December 2024, 6:21 pm EST

    Thank you @katyayny a lot for solving this issue, this is working.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels