Skip to content

Troubleshooting

Common issues and how to resolve them quickly.

  • Cause: The host container element has height: 0 (or unconstrained flex/grid height), so the viewport measures zero visible rows.
  • Solution: Give the container an explicit height (for example height: 400px or flex: 1; min-height: 0). See Installation.
  • Cause: next-grid-js/styles.css was not imported. JavaScript entries never auto-load CSS.
  • Solution: Add import 'next-grid-js/styles.css'; once in your app entry (or add it to styles in angular.json).

Grid option "..." requires ExportModule / ClipboardModule

Section titled “Grid option "..." requires ExportModule / ClipboardModule”
  • Cause: Using next-grid-js/core with dataExport or clipboard without registering the corresponding module.
  • Solution: Import ExportModule from 'next-grid-js/export' or ClipboardModule from 'next-grid-js/clipboard' and pass modules: [...]. See Entries & Modules.
  • Cause: rowSelection or cellSelection requires a row identity strategy (getRowId, rowKey, generateRowId, or rowSource.getRowId).
  • Solution: Add getRowId: (row) => row.id (with unique non-empty strings). See Row Identity & Epochs.
  • Cause: Two rows return the same ID from getRowId or rowKey.
  • Solution: Ensure row IDs are unique across the entire dataset (or use a composite rowKey: ['tenantId', 'id']).
  • Cause: Calling setRowData, changing the column’s editing functions via setColumnDefs, or scrolling the edited cell out of the recycled pool closes active edit sessions (editSessionChanged fires with 'dataChange', 'columnChange', or 'recycle').
  • Solution: Use applyRowTransaction for targeted updates and memoize columnDefs in framework components.
  • Cause: cellDataType defaults to 'auto', and stringified numbers/dates sort as text if not typed.
  • Solution: Set cellDataType: 'number', 'date', or 'dateTime' on ColumnDef<T>. See Column Definitions.

columnDefs Recreates Columns on Every React Render

Section titled “columnDefs Recreates Columns on Every React Render”
  • Cause: Passing an inline array literal columnDefs={[...]} creates new object references on each render, causing setColumnDefs to re-run processing.
  • Solution: Memoize columnDefs with useMemo (or computed in Vue, $derived in Svelte, readonly class field in Angular). See Frameworks Overview.
  • Cause: Calling new Grid(...) during server rendering.
  • Solution: Importing next-grid-js on the server is safe, but only instantiate Grid inside browser lifecycle hooks (useEffect, onMounted, afterNextRender) or use the official framework adapters.

Angular Runtime Failure (ɵɵngDeclare) Outside Angular CLI

Section titled “Angular Runtime Failure (ɵɵngDeclare) Outside Angular CLI”
  • Cause: Building next-grid-angular with standalone Vite or webpack without running the Angular Ivy linker.
  • Solution: Add @angular/compiler-cli/linker/babel to your bundler pipeline. See Angular.

grid Is null Inside Angular ngAfterViewInit

Section titled “grid Is null Inside Angular ngAfterViewInit”
  • Cause: <next-grid> initializes the grid after its first browser render.
  • Solution: Bind (gridReady)="grid = $event" instead of reading @ViewChild in ngAfterViewInit.

Construction-Only Prop Change Logs a Warning and Has No Effect

Section titled “Construction-Only Prop Change Logs a Warning and Has No Effect”
  • Cause: Options without setters (density, direction, localeText, rowHeight, modules) cannot change on a live instance.
  • Solution: Remount the grid using a new key (React), {#key} (Svelte), or @if/@for (Angular).

Transient Header/Body Drift During Rapid Scroll in Firefox

Section titled “Transient Header/Body Drift During Rapid Scroll in Firefox”
  • Cause: Known Firefox compositor timing behavior under rapid continuous scroll.
  • Solution: Expected transient behavior; offsets reconcile cleanly once scroll settles. See Browser & Tooling Support.