# Troubleshooting

> Fix a blank or unstyled Pivot Studio, fields that are ignored or detected as text, saved reports that load partly, worker fallbacks, plugin changes, slow large datasets and watermarks.

Pivot Studio validates data and reports instead of throwing. Warnings start with `Birch UI Pivot Studio:` in the console. Data that cannot be parsed also fires the `error` event.

| Symptom | Jump to |
| --- | --- |
| The widget is a short strip or empty | [The widget is blank](#the-widget-is-blank) |
| The field list and table are unstyled | [Pivot Studio has no styles](#pivot-studio-has-no-styles) |
| A number or date field can only be counted | [A field has the wrong type](#a-field-has-the-wrong-type) |
| `The value field "…" does not exist in the data; it is ignored.` | [A field in the report is ignored](#a-field-in-the-report-is-ignored) |
| `Field "…" appears in more than one of rows, columns and filters…` | [A field in the report is ignored](#a-field-in-the-report-is-ignored) |
| New data does not show up | [Data changes do not appear](#data-changes-do-not-appear) |
| The `error` event fires after `setData()` | [Data does not load](#data-does-not-load) |
| `the Web Worker failed (…); computing on the main thread` | [The worker falls back to the main thread](#the-worker-falls-back-to-the-main-thread) |
| `plugins can only be set when the widget is created…` | [A plugin change is ignored](#a-plugin-change-is-ignored) |
| Rearranging fields is slow | [Large datasets are slow](#large-datasets-are-slow) |
| "Birch UI Pivot Studio · unlicensed copy" in the corner | [A watermark appears](#a-watermark-appears) |
| `Refused to apply inline style` in the console | [A Content Security Policy blocks the styles](#a-content-security-policy-blocks-the-styles) |
| Two copies of a package, or a large bundle | [Duplicate packages and bundle size](#duplicate-packages-and-bundle-size) |
| Problems only in React, Vue, Svelte or Angular | [Framework adapters](#framework-adapters) |

## The widget is blank

**Cause.** Without a `height` option, the widget is `height: 100%` of its container, with a minimum of 320 pixels. A container without a height gives that minimum, which leaves little room for the table.

**Fix.** Give the container a height, or pass `height` as pixels or any CSS length:

```ts
createPivotStudio(document.querySelector<HTMLElement>('#store-sales')!, {
  data: storeSales,
  report,
  height: 'calc(100vh - 140px)',
});
```

## Pivot Studio has no styles

**Cause.** With `injectStyles: false`, the widget does not add its stylesheet.

**Fix.** Import `@birchui/pivot-studio/styles.css`, or insert the exported `pivotStudioStyles` string into a shadow root yourself. See [Importing the CSS file](https://docs.birchui.com/getting-started/installation.md#importing-the-css-file).

## A Content Security Policy blocks the styles

**Cause.** Injected styles are a `<style>` element, which a `style-src` policy without `'unsafe-inline'` blocks. The injected element has no nonce option.

**Fix.** Set `injectStyles: false` and import `@birchui/pivot-studio/styles.css` through your bundler. For the Web Worker, also see [The worker falls back to the main thread](#the-worker-falls-back-to-the-main-thread).

## A field has the wrong type

**Cause.** Types are detected from a sample of the records. A field becomes a `number` or `date` only when every non-empty sampled value is one. Dates such as `14/03/2026`, numbers with currency symbols, or a single text value such as `'n/a'` in a numeric column make the field text, which can only be counted.

**Fix.** Send numbers and ISO dates, or `Date` objects, and replace placeholders with empty values. To force a type, use a field definition. See [Field detection](https://docs.birchui.com/pivot-studio/data.md#field-detection) and [Field definitions](https://docs.birchui.com/pivot-studio/data.md#field-definitions).

## A field in the report is ignored

**Cause.** A report saved earlier, or written by hand, can refer to fields the current data does not have. Pivot Studio drops them and logs one of:

```text
Birch UI Pivot Studio: The value field "grossMargin" does not exist in the data; it is ignored.
Birch UI Pivot Studio: A filter refers to the field "channel", which does not exist in the data; it is ignored.
Birch UI Pivot Studio: Field "region" appears in more than one of rows, columns and filters; the later one is ignored.
Birch UI Pivot Studio: addField: the field "Region" does not exist
```

**Fix.** Use the field names from the data, not captions; captions such as "Order date" come from names such as `orderDate`. Check the names `dataLoaded` reports in `fields`, and clean stored reports with `normalizeReport()`. See [Robust loading](https://docs.birchui.com/pivot-studio/saving-reports.md#robust-loading).

## Data changes do not appear

**Cause.** Changing the record objects you passed in does not tell the widget.

**Fix.** Call `setData()` with the new records, or call `refresh()` after an in-place change:

```ts
for (const sale of studio.getRecords()) if (sale.store === 'Leeds Briggate') sale.store = 'Leeds Trinity';
await studio.refresh();
```

See [Changing records in place](https://docs.birchui.com/pivot-studio/data.md#changing-records-in-place).

## Data does not load

**Cause.** When CSV or JSON text cannot be parsed, the widget keeps its previous data, logs the problem with `console.error` and fires the `error` event. With `dataFormat: 'auto'`, text that starts with `[` or `{` is read as JSON and anything else as CSV.

**Fix.** Listen for `error` to tell the user, and pass `{ format: 'csv' }` or `{ format: 'json' }` to `setData()` to skip detection. See [Data sources](https://docs.birchui.com/pivot-studio/data.md#data-sources).

## The worker falls back to the main thread

**Cause.** With `worker: true`, aggregation runs in a Web Worker created from a `blob:` URL. A Content Security Policy that does not allow `blob:` workers makes it fail, and Pivot Studio logs `Birch UI Pivot Studio: the Web Worker failed (…); computing on the main thread`.

**Fix.** Add `blob:` to `worker-src`:

```text
Content-Security-Policy: worker-src 'self' blob:
```

See [Aggregating in a Web Worker](https://docs.birchui.com/pivot-studio/performance.md#aggregating-in-a-web-worker).

## A plugin change is ignored

**Cause.** `plugins`, such as the pivot chart, are installed when the widget is created. Changing them later logs `plugins can only be set when the widget is created; the new list is ignored`. In a framework, an inline `plugins` array triggers this on every render.

**Fix.** Define the plugin list once, outside the component, and recreate the widget if it must change. See [The widget updates on every render](https://docs.birchui.com/frameworks/troubleshooting.md#the-widget-updates-on-every-render).

## Large datasets are slow

**Cause.** Aggregation runs on the main thread by default. High-cardinality fields in Columns, such as an order ID, create thousands of columns, and every loaded field is encoded.

**Fix.** Set `worker: true` above about 100,000 records, drop unused fields before loading, keep high-cardinality fields out of Columns, and reuse the widget with `setData()` and `setReport()`. See [Tips for large datasets](https://docs.birchui.com/pivot-studio/performance.md#tips-for-large-datasets).

## A watermark appears

**Cause.** Pivot Studio checks its key for `pivot-studio` offline. On a non-local host with no valid key, a watermark appears and one warning is logged, for example:

```text
[Birch UI] No license key is set for Birch UI Pivot Studio. 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
```

A Grid Pro key reports `does not include Birch UI Pivot Studio`; Pivot Studio needs its own key. Pivot charts from `@birchui/pivot-studio/charts` are drawn by Birch UI Charts and check a Charts key, so they can show a Birch UI Charts watermark even when the table is licensed.

**Fix.** Call `setLicenseKey` from `@birchui/license` in the browser bundle, or pass `licenseKey` to `createPivotStudio`. With server rendering, expose the key through a public variable such as `NEXT_PUBLIC_BIRCHUI_LICENSE_KEY`; 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) and [What happens without a valid key](https://docs.birchui.com/getting-started/licensing.md#what-happens-without-a-valid-key).

## Duplicate packages and bundle size

**Cause.** Two installed versions of `@birchui/core` or `@birchui/license` split their state, so a key set in one copy is not seen by the other.

**Fix.** Run `npm ls @birchui/core @birchui/license`, align all `@birchui/*` packages on one version and run `npm dedupe`, or add `overrides` in `package.json`. The pivot chart lives in the `@birchui/pivot-studio/charts` subpath, so it is bundled only when you import it.

## Framework adapters

Wrap the widget with `createReactComponent(pivotStudioDefinition)` or the equivalent factory. A new `data` array on every render reloads the data each time. See [Framework troubleshooting](https://docs.birchui.com/frameworks/troubleshooting.md), in particular [Vue makes large data slow](https://docs.birchui.com/frameworks/troubleshooting.md#vue-makes-large-data-slow), [Svelte state makes large data slow](https://docs.birchui.com/frameworks/troubleshooting.md#svelte-state-makes-large-data-slow) and [The widget is created twice in development](https://docs.birchui.com/frameworks/troubleshooting.md#the-widget-is-created-twice-in-development).

## Related

- [API reference: @birchui/pivot-studio](https://docs.birchui.com/api/pivot-studio.md)
- [Performance](https://docs.birchui.com/pivot-studio/performance.md)
