# Troubleshooting

> Fix Grid Pro features that do nothing because a module is missing, watermarks, ignored grouping and aggregation columns, flat tree data and blocked clipboard reads.

Grid Pro reports problems in the browser console. Messages from the core grid start with `Birch UI Grid:`, and messages from Grid Pro modules start with `[Birch UI Grid Pro]`. For problems that also affect the free grid, such as a blank grid or rows that do not update, see [Grid troubleshooting](https://docs.birchui.com/grid/troubleshooting.md).

| Symptom | Jump to |
| --- | --- |
| `Birch UI Grid: Row grouping needs RowGroupingModule…` | [A feature does nothing](#a-feature-does-nothing) |
| `api.exportExcel` or `api.setGroupBy` is `undefined` | [A Pro API method is undefined](#a-pro-api-method-is-undefined) |
| `Cannot group by unknown column` or `Unknown aggFunc` | [Grouping or aggregation skips a column](#grouping-or-aggregation-skips-a-column) |
| Tree data shows a flat list | [Tree data shows a flat list](#tree-data-shows-a-flat-list) |
| Paste does nothing | [Paste does nothing](#paste-does-nothing) |
| Pivot or tree data is ignored with `rowModel: 'server'` | [The server-side row model ignores pivot or tree data](#the-server-side-row-model-ignores-pivot-or-tree-data) |
| "Birch UI Grid Pro · unlicensed copy" in the corner | [A watermark appears](#a-watermark-appears) |
| The watermark is still there in a server-rendered app | [The key is not applied with server rendering](#the-key-is-not-applied-with-server-rendering) |
| Grid Pro rows or panels look unstyled | [Grid Pro styles are missing](#grid-pro-styles-are-missing) |
| Modules have no effect and types do not match | [Two copies of @birchui/core are installed](#two-copies-of-birchuicore-are-installed) |
| The bundle includes every module | [The bundle is too large](#the-bundle-is-too-large) |

## A feature does nothing

**Cause.** Grid Pro features are modules. When you set an option such as `groupBy`, `rowGroup`, `aggFunc`, `treeData`, `pivot.enabled`, `rangeSelection`, `fillHandle`, `masterDetail` or `statusBar` without the module that reads it, the grid ignores the option and logs a hint once per feature:

```text
Birch UI Grid: Row grouping needs RowGroupingModule from @birchui/grid-pro. Add it with createGrid(el, { modules: [RowGroupingModule] }). The option is ignored until then.
```

**Fix.** Add the module named in the message:

```ts title="sales-grid.ts"
import { createGrid } from '@birchui/core';
import { AggregationModule, RowGroupingModule } from '@birchui/grid-pro';

createGrid(document.querySelector<HTMLElement>('#sales')!, {
  columns: [
    { field: 'region', rowGroup: true },
    { field: 'rep', header: 'Sales rep' },
    { field: 'revenue', type: 'number', aggFunc: 'sum' },
  ],
  rows: sales,
  getRowId: (sale) => sale.id,
  modules: [RowGroupingModule, AggregationModule],
});
```

`aggFunc` works without `AggregationModule` when grouping, tree data or pivoting is installed, because those modules aggregate their own groups. In a framework adapter, keep the `modules` array in a constant so it is not recreated on each render. See [Register modules](https://docs.birchui.com/grid-pro/overview.md#register-modules).

## A Pro API method is undefined

**Cause.** Pro modules add methods to the grid API when they install and remove them when they uninstall. `exportExcel` exists only with `ExcelModule`, `setGroupBy` only with `RowGroupingModule`, and so on.

**Fix.** Install the module, and call Pro methods with optional chaining or after checking `hasModule`:

```ts
import { ExcelModule } from '@birchui/grid-pro';

if (api.hasModule(ExcelModule.name)) await api.exportExcel?.({ fileName: 'q3-sales.xlsx' });
```

The table in [Calling Pro API methods](https://docs.birchui.com/grid-pro/overview.md#calling-pro-api-methods) lists the methods each module adds.

## Grouping or aggregation skips a column

**Cause.** A `groupBy` entry or pivot column that does not match a column ID, or an `aggFunc` name the grid does not know, is skipped with a warning:

```text
[Birch UI Grid Pro] Cannot group by unknown column "territory"; it is ignored.
[Birch UI Grid Pro] Unknown aggFunc "total" on column "revenue"; it is ignored.
```

**Fix.** Use column IDs, which default to `field`, not header text. Use a built-in aggregation name such as `'sum'`, `'avg'`, `'min'`, `'max'` or `'count'`, or pass a function. See [Aggregation](https://docs.birchui.com/grid-pro/aggregation.md).

## Tree data shows a flat list

**Cause.** `treeData: true` needs a way to find each row's place in the tree. Without one, the grid logs `[Birch UI Grid Pro] treeData needs getDataPath or getParentId; showing a flat list.`

**Fix.** Pass `getDataPath` for path-shaped data or `getParentId` for parent references, together with `TreeDataModule`:

```ts
createGrid(container, {
  columns,
  rows: employees,
  getRowId: (employee) => employee.id,
  treeData: true,
  getParentId: (employee) => employee.managerId,
  modules: [TreeDataModule],
});
```

See [Tree data](https://docs.birchui.com/grid-pro/tree-data.md).

## Paste does nothing

**Cause.** The grid leaves clipboard keys alone while a cell editor is open, while focus is in an input or content-editable element, and when `clipboard` is `false`. `pasteFromClipboard()` also needs the browser's permission to read the clipboard. When the browser refuses, it logs `[Birch UI Grid Pro] Reading the clipboard was blocked by the browser.` and pastes nothing.

**Fix.** Install `ClipboardModule`, close the editor before pasting, and serve the page over HTTPS or `localhost`. Keyboard paste with Ctrl+V or Cmd+V needs no permission; for a toolbar button, read the text yourself and call `api.pasteText?.(text)`. See [When the grid does not handle the clipboard](https://docs.birchui.com/grid-pro/clipboard.md#when-the-grid-does-not-handle-the-clipboard).

## The server-side row model ignores pivot or tree data

**Cause.** The server-side row model loads rows in blocks from your datasource, so pivoting and tree data cannot run on the client. The grid logs `[Birch UI Grid Pro] Pivot mode is not available with the server-side row model; it is ignored.` or the matching message for tree data. `ServerSideRowModelModule` is also not part of `AllProModules`.

**Fix.** Add `ServerSideRowModelModule` to `modules` yourself, and pivot or build trees on the server. Invalid `serverSide.blockSize`, `serverSide.maxBlocksInCache` and `serverSide.debounceMs` values fall back to defaults with a warning that names the option.

## A watermark appears

**Cause.** The first Pro module that installs checks the license key for `grid-pro`. When the key is missing, malformed, altered, expired or for another product, every feature keeps working, a "Birch UI Grid Pro · unlicensed copy" or "trial expired" watermark appears on non-local hosts, and one warning is logged:

```text
[Birch UI] No license key is set for Birch UI Grid Pro. All features keep working; a watermark is shown on non-local hosts until a valid license key is set. Purchase a license at https://birchui.com/pricing
```

**Fix.** Set the key once, before or after the grid is created:

```ts title="main.ts"
import { setLicenseKey } from '@birchui/license';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);
```

A `licenseKey` passed to `createGrid` applies to that grid only and overrides the global key. A key for Scheduler or another product reports `does not include Birch UI Grid Pro`. No watermark is shown on `localhost`, `127.0.0.1` or `*.local` hosts, so a missing key often shows up first on staging. See [Licensing and activation](https://docs.birchui.com/getting-started/licensing.md#what-happens-without-a-valid-key).

## The key is not applied with server rendering

**Cause.** `setLicenseKey` called only in server code, or a key read from a private environment variable, never reaches the browser bundle.

**Fix.** Call `setLicenseKey` in a module that runs in the browser, and expose the key as a public variable such as `NEXT_PUBLIC_BIRCHUI_LICENSE_KEY` or `VITE_BIRCHUI_LICENSE_KEY`, defined at build time. See [The license key is not applied with server rendering](https://docs.birchui.com/frameworks/troubleshooting.md#the-license-key-is-not-applied-with-server-rendering).

## Grid Pro styles are missing

**Cause.** With `injectStyles: false`, neither the core nor the Grid Pro styles are injected. Group rows, range highlights, the fill handle, detail panels and the status bar then lose their styling. A Content Security Policy without `'unsafe-inline'` in `style-src` has the same effect on injected styles.

**Fix.** Import both stylesheets:

```ts title="main.ts"
import '@birchui/core/styles.css';
import '@birchui/grid-pro/styles.css';
```

The same CSS is exported as the strings `gridStyles` and `gridProStyles` for shadow roots. See [Importing the CSS file](https://docs.birchui.com/getting-started/installation.md#importing-the-css-file).

## Two copies of @birchui/core are installed

**Cause.** `@birchui/grid-pro` imports `@birchui/core`. If npm installs a second copy, for example because the versions of the two packages differ, modules can be typed and loaded against a different core than the grid you create.

**Fix.** Run `npm ls @birchui/core`, upgrade every `@birchui/*` package to the same version, then run `npm dedupe`. Use `overrides` in `package.json` when a dependency pins another version. See [Two copies of @birchui/core are installed](https://docs.birchui.com/grid/troubleshooting.md#two-copies-of-birchuicore-are-installed).

## The bundle is too large

**Cause.** `AllProModules` includes every analytics and interaction module, including Excel export.

**Fix.** List the modules you use, such as `[RowGroupingModule, AggregationModule, StatusBarModule]`. Bundlers drop the rest because the package is marked side-effect free apart from its CSS.

## Framework adapters

For React Strict Mode, Vue proxies, Svelte `$state.raw` and the Angular zone, see [Framework troubleshooting](https://docs.birchui.com/frameworks/troubleshooting.md).

## Related

- [API reference: @birchui/grid-pro](https://docs.birchui.com/api/grid-pro.md)
- [Grid Pro overview and activation](https://docs.birchui.com/grid-pro/overview.md)
