drizzle-team/drizzle-orm · error · Error

minValue and maxValue should be the same type.

Error message

minValue and maxValue should be the same type.

What it means

Error "minValue and maxValue should be the same type." thrown in drizzle-team/drizzle-orm.

Source

Thrown at drizzle-seed/src/services/Generators.ts:692

		const integersCount = new Map();

		if (typeof minValue === 'bigint' && typeof maxValue === 'bigint') {
			if (this.skipCheck === false && maxValue - minValue + BigInt(1) < count) {
				throw new Error(
					'count exceeds max number of unique integers in given range(min, max), try to make range wider.',
				);
			}
		} else if (typeof minValue === 'number' && typeof maxValue === 'number') {
			minValue = minValue >= 0 ? Math.ceil(minValue) : Math.floor(minValue);
			maxValue = maxValue >= 0 ? Math.floor(maxValue) : Math.ceil(maxValue);
			if (this.skipCheck === false && maxValue - minValue + 1 < count) {
				throw new Error(
					'count exceeds max number of unique integers in given range(min, max), try to make range wider.',
				);
			}
		} else {
			throw new Error(
				'minValue and maxValue should be the same type.',
			);
		}

		this.state = { rng, minValue, maxValue, intervals, integersCount };
	}

	generate() {
		if (this.state === undefined) {
			throw new Error('state is not defined.');
		}

		let intervalIdx: number,
			numb: number | bigint | undefined;

		const intervalsToAdd: (number | bigint)[][] = [];

		if (this.state.intervals.length === 0) {

View on GitHub (pinned to b7862528fd)

Solutions

  1. Pass minValue and maxValue of the same type (both numbers or both dates) to the generator.

When it happens

Trigger: Passing minValue and maxValue of different types (e.g. number vs bigint/string) to an int generator.

Common situations: Mixing number and bigint bounds; values parsed from config as strings.


AI-assisted analysis of drizzle-team/drizzle-orm@b7862528fd (2026-08-03). Data as JSON: /data/errors/108a5d51d8318fc8.json. Report an issue: GitHub.