Skip to content

Cannot convert 0 to a BigInt error when loading uint64 Zarr data #28

@dchen116

Description

@dchen116

Description

When loading Zarr v2 segmentation data with uint64 dtype, I get a JavaScript TypeError:

Cannot convert 0 to a BigInt

Analysis

The error appears to be related to how fill_value is handled for 64-bit integer types. The fill_value: 0 in the Zarr
metadata is parsed as a JavaScript Number, but BigInt typed arrays require BigInt values (e.g., 0n instead of 0).

Reference: zarr-specs#334 discusses this broader issue with
JSON encoding of int64/uint64 values in JavaScript.

Data Specifications

  • Format: Zarr v2
  • dtype: uint64 (<u8)
  • fill_value: 0
  • Chunks: 32x32x32
  • Compression: zstd
  • Multi-scale pyramid: 7 levels

Notes

  • The same data loads correctly in Neuroglancer
  • The data passes the OME-NGFF validator
  • Small dense arrays may not trigger this bug (only occurs when sparse chunks need fill_value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions