ag-Grid: HTMLElement is not defined #1257

Closed
opened 2025-08-09 17:19:27 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @bperry77 on 11/16/2016

I am trying to add ag-Grid to my Angular 2 project but I get the following error:

Exception: Call to Node module failed with error: ReferenceError: HTMLElement is not defined

As I understand, this is because I have prerendering enabled

<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>

which is not executed in the context of a DOM.

Disabling prerendering fixes the issue but now I have lost the benefit of prerendering. Is there a way I can exclude ag-Grid code in server-side prerendering?

Thanks!

*Originally created by @bperry77 on 11/16/2016* I am trying to add [ag-Grid](https://www.npmjs.com/package/ag-grid-ng2) to my Angular 2 project but I get the following error: > Exception: Call to Node module failed with error: ReferenceError: HTMLElement is not defined As I understand, this is because I have prerendering enabled `<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>` which is not executed in the context of a DOM. Disabling prerendering fixes the issue but now I have lost the benefit of prerendering. Is there a way I can exclude ag-Grid code in server-side prerendering? Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1257
No description provided.