TypeScript error

TS8023: An @extends tag that does not match the extends clause

  • Error TS8023
  • Tested with TypeScript 5.9

error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause. is reported when the class named in an @extends (or @augments) tag is not the one in the extends clause. The tag's job in JavaScript is to supply type arguments to a generic base class, @extends {Queue<string>}, which the extends clause has no syntax for; it cannot change which class is extended.

It usually follows a refactor: the base class changed and the tag above the subclass still names the old one. The error is reported inside the JSDoc comment.

At a glance

CodeTS8023
MessageJSDoc '@{0} {1}' does not match the 'extends {2}' clause.
TypeScript's categoryerror
Listed underJavaScript files only
Turned on by No option: every checked file reports it
In .js files Reported when the file is checked: checkJs in jsconfig.json, or // @ts-check at the top of the file

The message is TypeScript's own text from its diagnostic messages file (Apache-2.0); {0}, {1} and {2} are filled in by tsc for each error.

What it looks like

inbox.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: inbox.js(14,15): error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. inbox.js(14,15): error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause. 7.0.2 : differs, see why TypeScript 7.0.2, run 21 October 2026: differs from 5.9.3. inbox.js(14,15): error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause. inbox.js(15,28): error TS8026: Expected Queue<T> type arguments; provide these with an '@extends' tag. checked 21 October 2026
/** @template T */
export class Collection {
  /** @type {T[]} */
  items = [];
}

/** @template T */
export class Queue {
  /** @type {T[]} */
  waiting = [];
}

/** @extends {Collection<string>} */error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause.
export class Inbox extends Queue {}
An @extends tag that names a different class from the extends clause.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

What causes it

  • The extends clause was changed and the @extends tag was not.
  • The tag names an interface or type, hoping to describe the class; use @implements for that.

How to fix it

Name the same class, with its type arguments

Write @extends {Queue<string>} above class Inbox extends Queue. The subclass then knows that waiting holds strings.

inbox.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
/** @template T */
export class Collection {
  /** @type {T[]} */
  items = [];
}

/** @template T */
export class Queue {
  /** @type {T[]} */
  waiting = [];
}

/** @extends {Queue<string>} */
export class Inbox extends Queue {}

const inbox = new Inbox();
inbox.waiting.push("Welcome");
@extends names the class the code extends, with its type argument.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

Under TypeScript 6.0 and 7.0

Every example on this page also runs under TypeScript 6.0.3 and 7.0.2 when this site is built. One of them reports something different from 5.9.3, the version the page describes; the ✗ on its badge links to its entry below.

A mismatched @extends also reports the missing type arguments

TypeScript 7.0 · JSDoc and JavaScript patterns 7.0 no longer reads

The pattern: @extends {Collection<string>} on a class that extends Queue, a generic class.

Why: Every version reports the mismatch (TS8023). TypeScript 7.0.2 also reports that Queue gets no type arguments (TS8026), because the @extends tag that should provide them names another class. The port's list of changes does not mention it. Source: CHANGES.md: changes between TypeScript 6 and the native port.

An @extends tag that names a different class from the extends clause inbox.js

TypeScript 5.9.3
inbox.js(14,15): error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause.
TypeScript 6.0.3same as 5.9.3

The same errors as 5.9.3.

TypeScript 7.0.2differs from 5.9.3
inbox.js(14,15): error TS8023: JSDoc '@extends Collection' does not match the 'extends Queue' clause.
inbox.js(15,28): error TS8026: Expected Queue<T> type arguments; provide these with an '@extends' tag.

What works in every version: Name the same class in @extends and in extends, with its type arguments.

The example @extends names the class the code extends, with its type argument on this page shows it, with the same result under every version.

Gotchas

  • An @extends tag on a class with no extends clause is ignored without any error, so it cannot add a base class.
  • Without the tag, a generic base class's type parameters are any in JavaScript, which is why the tag exists.

Sources

Last reviewed 20 October 2026.