Issue: ReferenceError: window is not defined When Running Angular 18 SSR with A

Posted by: surya on 12 June 2025, 5:58 am EST

    • Post Options:
    • Link

    Posted 12 June 2025, 5:58 am EST

    Hi Team,

    We have integrated Angular 18 with Server-Side Rendering (SSR) using Angular Universal. However, when we try to run the application using the SSR build, we are encountering the following error:

    /Users/shubhamchhapre/Documents/GitHub/zx-report-UI/dist/zx-report/server/vendor.js:678916
    window.arjsViewer = window.arjsViewer || {};
    ^
    ReferenceError: window is not defined
    

    It appears that the library is trying to access the window object, which is not available in a Node.js environment during SSR.

    Could you please provide guidance on how to use ActiveReportsJS in an Angular SSR setup, or suggest a workaround to prevent this error?

    Looking forward to your support on this issue.

    Thank you

  • Posted 13 June 2025, 3:36 am EST

    Hi Surya,

    This is the forum for Wijmo. Therefore, we have responded to you on your query in the ActiveReports forum here: https://developer.mescius.com/forums/activereportsjs/issue-referenceerror-window-is-not-defined-when-running-angular-18-ssr.

    Regards,

    Anand

Need extra support?

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

Learn More

Forum Channels