denoland/deno · error · Error

Limit must be a positive integer: received ${options.limit}

Error message

Limit must be a positive integer: received ${options.limit}

What it means

Error "Limit must be a positive integer: received ${options.limit}" thrown in denoland/deno.

Source

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

    );
    if (!result) throw new TypeError("Failed to set value");
  }

  list(
    selector: Deno.KvListSelector,
    options: {
      limit?: number;
      batchSize?: number;
      cursor?: string;
      reverse?: boolean;
      consistency?: Deno.KvConsistencyLevel;
    } = { __proto__: null },
  ): KvListIterator {
    if (
      options.limit !== undefined &&
      (!NumberIsInteger(options.limit) || options.limit <= 0)
    ) {
      throw new Error(
        `Limit must be a positive integer: received ${options.limit}`,
      );
    }

    let batchSize = options.batchSize ?? (options.limit ?? 100);
    if (!NumberIsInteger(batchSize) || batchSize <= 0) {
      throw new Error(
        `batchSize must be a positive integer: received ${batchSize}`,
      );
    }
    if (options.batchSize === undefined && batchSize > 500) batchSize = 500;

    return new KvListIterator({
      limit: options.limit,
      selector,
      cursor: options.cursor,
      reverse: options.reverse ?? false,
      consistency: options.consistency ?? "strong",

View on GitHub (pinned to 89f33cbef2)

When it happens

Trigger: Thrown at ext/kv/01_db.ts:243 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/6f7877f37f0ed3fa. Report an issue: GitHub.