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
| Code | TS8023 |
|---|---|
| Message | JSDoc '@{0} {1}' does not match the 'extends {2}' clause. |
| TypeScript's category | error |
| Listed under | JavaScript 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
/** @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 {}jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": ["*.js"]
} What causes it
- The
extendsclause was changed and the@extendstag was not. - The tag names an interface or type, hoping to describe the class; use
@implementsfor 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.
/** @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");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
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
@extendstag on a class with noextendsclause is ignored without any error, so it cannot add a base class. - Without the tag, a generic base class's type parameters are
anyin JavaScript, which is why the tag exists.
Sources
- JSDoc Reference: @extends · TypeScript handbook
- Type Checking JavaScript Files: Unspecified type parameters default to any · TypeScript handbook
- diagnosticMessages.json (TypeScript 5.9.3) · TypeScript on GitHub
Last reviewed 20 October 2026.