TypeScript error

TS4122: @override on a member the base class does not have

  • Error TS4122
  • Tested with TypeScript 5.9

error TS4122: This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class 'Shape'. is reported for an @override tag on a member that overrides nothing. It is checked whether or not noImplicitOverride is on.

This is the check that makes @override worth writing: if the base class renames area to surface, every subclass area that says @override is reported, instead of quietly becoming an unrelated method.

At a glance

CodeTS4122
MessageThis member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'.
TypeScript's categoryerror
Listed underClasses, JSX and unused code
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} is filled in by tsc for each error.

What it looks like

shapes.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: shapes.js(16,3): error TS4122: This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class 'Shape'. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. shapes.js(16,3): error TS4122: This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class 'Shape'. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. shapes.js(16,3): error TS4122: This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class 'Shape'. checked 21 October 2026
export class Shape {
  area() {
    return 0;
  }
}

export class Square extends Shape {
  /** @param {number} side */
  constructor(side) {
    super();
    this.side = side;
  }

  /** @override */
  perimeter() {error TS4122: This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class 'Shape'.
    return 4 * this.side;
  }
}
@override on a method the base class does not have.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

What causes it

  • The member's name is misspelled, or the base class method was renamed or removed.
  • The method is new in the subclass and was tagged by habit.

How to fix it

Override a real member, or remove the tag

Rename the method to the base class's name if it was meant to override, or drop @override from a method that is new in the subclass.

shapes.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
export class Shape {
  area() {
    return 0;
  }
}

export class Square extends Shape {
  /** @param {number} side */
  constructor(side) {
    super();
    this.side = side;
  }

  /** @override */
  area() {
    return this.side ** 2;
  }

  perimeter() {
    return 4 * this.side;
  }
}
@override only where the base class has the method.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

Gotchas

  • A class without an extends clause has no base class, so @override there is a different error, TS4121 ("its containing class ... does not extend another class").

Sources

Last reviewed 20 October 2026.