Troubleshooting
Common issues and how to resolve them quickly.
Grid Has Zero Height or Renders Nothing
Section titled “Grid Has Zero Height or Renders Nothing”- 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: 400pxorflex: 1; min-height: 0). See Installation.
Grid Renders Unstyled HTML
Section titled “Grid Renders Unstyled HTML”- Cause:
next-grid-js/styles.csswas not imported. JavaScript entries never auto-load CSS. - Solution: Add
import 'next-grid-js/styles.css';once in your app entry (or add it tostylesinangular.json).
Grid option "..." requires ExportModule / ClipboardModule
Section titled “Grid option "..." requires ExportModule / ClipboardModule”- Cause: Using
next-grid-js/corewithdataExportorclipboardwithout registering the corresponding module. - Solution: Import
ExportModulefrom'next-grid-js/export'orClipboardModulefrom'next-grid-js/clipboard'and passmodules: [...]. See Entries & Modules.
Row Selection Rejects or Does Nothing
Section titled “Row Selection Rejects or Does Nothing”- Cause:
rowSelectionorcellSelectionrequires a row identity strategy (getRowId,rowKey,generateRowId, orrowSource.getRowId). - Solution: Add
getRowId: (row) => row.id(with unique non-empty strings). See Row Identity & Epochs.
Duplicate Row ID Diagnostics
Section titled “Duplicate Row ID Diagnostics”- Cause: Two rows return the same ID from
getRowIdorrowKey. - Solution: Ensure row IDs are unique across the entire dataset (or use a composite
rowKey: ['tenantId', 'id']).
Active Editor Closes Unexpectedly
Section titled “Active Editor Closes Unexpectedly”- Cause: Calling
setRowData, changing the column’s editing functions viasetColumnDefs, or scrolling the edited cell out of the recycled pool closes active edit sessions (editSessionChangedfires with'dataChange','columnChange', or'recycle'). - Solution: Use
applyRowTransactionfor targeted updates and memoizecolumnDefsin framework components.
Numbers or Dates Sort Lexicographically
Section titled “Numbers or Dates Sort Lexicographically”- Cause:
cellDataTypedefaults to'auto', and stringified numbers/dates sort as text if not typed. - Solution: Set
cellDataType: 'number','date', or'dateTime'onColumnDef<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, causingsetColumnDefsto re-run processing. - Solution: Memoize
columnDefswithuseMemo(orcomputedin Vue,$derivedin Svelte,readonlyclass field in Angular). See Frameworks Overview.
document is not defined During SSR
Section titled “document is not defined During SSR”- Cause: Calling
new Grid(...)during server rendering. - Solution: Importing
next-grid-json the server is safe, but only instantiateGridinside 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-angularwith standalone Vite or webpack without running the Angular Ivy linker. - Solution: Add
@angular/compiler-cli/linker/babelto 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@ViewChildinngAfterViewInit.
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.