denoland/deno · error · RangeError

Value must be a positive bigint: received ${value}

Error message

Value must be a positive bigint: received ${value}

What it means

Error "Value must be a positive bigint: received ${value}" thrown in denoland/deno.

Source

Thrown at ext/kv/01_db.ts:735

      return "AtomicOperation (empty)";
    }

    return `AtomicOperation\n${ArrayPrototypeJoin(operations, "\n")}`;
  }
}

const MIN_U64 = BigInt("0");
const MAX_U64 = BigInt("0xffffffffffffffff");

class KvU64 {
  value: bigint;

  constructor(value: bigint) {
    if (typeof value !== "bigint") {
      throw new TypeError(`Value must be a bigint: received ${typeof value}`);
    }
    if (value < MIN_U64) {
      throw new RangeError(
        `Value must be a positive bigint: received ${value}`,
      );
    }
    if (value > MAX_U64) {
      throw new RangeError("Value must fit in a 64-bit unsigned integer");
    }
    this.value = value;
    ObjectFreeze(this);
  }

  valueOf() {
    return this.value;
  }

  toString() {
    return BigIntPrototypeToString(this.value);
  }

View on GitHub (pinned to 89f33cbef2)

When it happens

Trigger: Thrown at ext/kv/01_db.ts:735 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16). Data as JSON: /api/errors/00607af028a60c9b. Report an issue: GitHub.