Birch UI v0.1
Pricing

TroubleshootingSpreadsheet

Fix a spreadsheet that does not fill its container,

Open .md

Formula problems show up in the cells as Excel-style errors. Component problems are reported through the error event and in the console with the prefix [Birch UI Spreadsheet].

Symptom Jump to
The sheet is 480 pixels tall whatever the container The spreadsheet does not fill its container
Cells, headers and the formula bar are unstyled The spreadsheet has no styles
A formula shows #NAME? A formula shows #NAME?
A formula with ; separators is rejected A formula shows #NAME?
A formula shows #SPILL! A formula shows #SPILL!
A formula shows #BLOCKED! A formula shows #BLOCKED!
A picture is an empty dashed frame A picture is an empty frame
Cells show 0 and an error event reports circularReference A circular reference shows 0
Conditional formats or validation disappear after an xlsx round trip Formatting is lost in xlsx files
Excel opens a spilling formula as a single value Formatting is lost in xlsx files
A date shows as a number such as 46096 Dates show as numbers
Typing is slow in a large workbook Recalculation is slow
"Birch UI Spreadsheet · unlicensed copy" in the corner A watermark appears
Refused to apply inline style in the console A Content Security Policy blocks the styles
Two copies of a package, or a large bundle Duplicate packages and bundle size
Problems only in React, Vue, Svelte or Angular Framework adapters

The spreadsheet does not fill its container#

Cause. Unlike the grid, the spreadsheet does not take its container's height. Without a height option it is 480 pixels tall, with a minimum of 200.

Fix. Pass height as pixels or any CSS length. Use '100%' to fill a container that has a height:

TypeScript
createSpreadsheet(document.querySelector<HTMLElement>('#loan-model')!, {
  data: loanModel,
  height: '100%',
});

The spreadsheet has no styles#

Cause. With injectStyles: false, the spreadsheet does not add its stylesheet.

Fix. Import @birchui/spreadsheet/styles.css, or insert the exported spreadsheetStyles string into a shadow root yourself. See 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/spreadsheet/styles.css through your bundler.

A formula shows #NAME?#

Cause. #NAME? means an unknown function or name, or syntax the parser does not support:

  • a function outside the built-in list, such as LINEST, T.DIST, CUBEVALUE or HYPERLINK;
  • a misspelled defined name;
  • a structured table reference such as Orders[Amount], a 3-D reference such as SUM(Jan:Dec!B5), or an R1C1 reference;
  • localized syntax, such as =SUMME(A1;A2) or =ROUND(B4;2).

Fix. Check the function reference and write formulas in the en-US syntax Excel stores in files: commas between arguments and English names. Replace table references with ranges or defined names, and add missing calculations as LAMBDA functions in defined names. See Formula language.

A formula shows #SPILL!#

Cause. A formula that returns several values, such as =FILTER(...) or =SEQUENCE(12), spills into the cells below and to the right. When a value already sits in that range, including one typed there later, the anchor shows #SPILL!.

Fix. Clear the cells in the way; the results come back automatically. The A1# spill operator is not supported, so refer to the range directly or wrap the formula in INDEX or TAKE. Set dynamicArrays: false for the implicit intersection of older Excel versions. See Dynamic arrays and spilling.

A formula shows #BLOCKED!#

Cause. The formula uses IMAGE with a web address. The spreadsheet makes no network requests, so it cannot load the picture itself.

Fix. Pass a resolveImage function that returns a data: or blob: URL for the addresses you trust, from pictures you fetched beforehand. It is not called in worker calculation. See The IMAGE function.

A picture is an empty frame#

Cause. The picture is in a format the spreadsheet stores but cannot draw: a TIFF with Deflate, JPEG or CCITT compression, tiles or 16-bit samples, or a metafile it cannot read. A picture whose src is a web address is not loaded either.

Fix. The file is intact and is written back unchanged, so Excel still shows it. To see it here, convert it to PNG before adding it, or use a data: URL. See Formats.

A circular reference shows 0#

Cause. A formula that depends on itself, directly or through other cells, is circular. The cells involved show 0 and the spreadsheet emits an error event with the code circularReference.

Fix. Break the loop, or turn on iterative calculation for models that are circular by design:

TypeScript
createSpreadsheet(container, {
  data: treasuryModel,
  iterativeCalculation: { maxIterations: 200, maxChange: 0.0001 },
});

sheet.on('error', ({ code, address }) => {
  if (code === 'circularReference') showNotice(`Circular reference at ${address}`);
});

See Circular references.

Formatting is lost in xlsx files#

Cause. Most formatting round-trips, including conditional formatting, data validation, strikethrough and dynamic arrays. What can go missing is narrower: a conditional formatting rule that exists only in the Excel 2010 extension and is not an icon set is kept in the file but not applied, and another program that saves the file in between may drop features of its own accord, as LibreOffice and openpyxl do with some data bar and icon set options. A file saved as .ods or .csv carries far less than xlsx.

Fix. Call getImportReport() after importXlsx(), or open Review > Import report, to see what a file kept and lost. Store the workbook JSON from toJSON() alongside the file when users rely on a feature that is not carried. See What round-trips and what an ods file carries.

Dates show as numbers#

Cause. Dates are serial numbers in the 1900 date system. A serial without a date number format shows as a number. Typed dates are read month first, as in en-US.

Fix. Give the cell a date number format, or pass a Date to setValue(), which stores a serial. Convert in code with dateToSerial() and serialToDate(), which work in UTC. See Dates and times.

Recalculation is slow#

Cause. Volatile functions (NOW, TODAY, RAND, OFFSET, INDIRECT and others) recalculate on every change. A loop of setValue() calls recalculates after each one, thousands of copied formulas are thousands of graph nodes, and calculation runs on the page's main thread.

Fix. Put TODAY() in one cell and refer to it, prefer INDEX to OFFSET, batch changes with setRange(), spill one formula instead of copying it down, and import xlsx files with xlsxToJSON() in a Web Worker. See Advice for large workbooks.

A watermark appears#

Cause. The spreadsheet checks its key for spreadsheet 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 Spreadsheet. 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. Call setLicenseKey from @birchui/license in the browser bundle, or pass licenseKey to createSpreadsheet. 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 and 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. Load the spreadsheet with a dynamic import() on the pages that need it; see Bundle size.

Framework adapters#

Wrap the spreadsheet with createReactComponent(spreadsheetDefinition) or the equivalent factory. Passing a new data object on every render reloads the workbook and clears the undo history, so load it once and read changes from cellChange events or toJSON(). See Framework troubleshooting, in particular The widget updates on every render and The widget is created twice in development.

↑ ↓ to move, Enter to open, Esc to close