drizzle-team/drizzle-orm · error · Error

Class "${type.name ?? '<unknown>'}" doesn't look like a Driz

Error message

Class "${type.name ?? '<unknown>'}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.

What it means

Error "Class "${type.name ?? '<unknown>'}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug." thrown in drizzle-team/drizzle-orm.

Source

Thrown at drizzle-orm/src/entity.ts:22

export interface DrizzleEntity {
	[entityKind]: string;
}

export type DrizzleEntityClass<T> =
	& ((abstract new(...args: any[]) => T) | (new(...args: any[]) => T))
	& DrizzleEntity;

export function is<T extends DrizzleEntityClass<any>>(value: any, type: T): value is InstanceType<T> {
	if (!value || typeof value !== 'object') {
		return false;
	}

	if (value instanceof type) { // eslint-disable-line no-instanceof/no-instanceof
		return true;
	}

	if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
		throw new Error(
			`Class "${
				type.name ?? '<unknown>'
			}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`,
		);
	}

	let cls = Object.getPrototypeOf(value).constructor;
	if (cls) {
		// Traverse the prototype chain to find the entityKind
		while (cls) {
			if (entityKind in cls && cls[entityKind] === type[entityKind]) {
				return true;
			}

			cls = Object.getPrototypeOf(cls);
		}
	}

View on GitHub (pinned to b7862528fd)

Solutions

  1. Verify the object passed is a Drizzle table/schema class (e.g. created via pgTable/mysqlTable/sqliteTable), not a plain object or an unrelated class.
  2. If the class is provided by Drizzle itself, report the issue on the drizzle-orm GitHub tracker.

When it happens

Trigger: Passing a class constructor to a Drizzle API (e.g. getTableConfig) that is not a Drizzle table/entity, or a class whose Drizzle symbols were lost via bundling or duplicate drizzle-orm copies.

Common situations: Multiple versions of drizzle-orm in node_modules; wrapping/extending Drizzle table classes; minifiers stripping static properties.


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