- Error
- Reported by the type checker
TS4113
This member cannot have an 'override' modifier because it is not declared in the base class '{0}'.
A member is marked override but the base class has no member with that name. Fix the name or remove override.
What it means
override says the member replaces one from the base class, but the base class doesn't declare a member of that name. Often the name is misspelled or the base member was renamed.
Example
class Base {
start() {}
}
class Child extends Base {
override stop() {}
}
export {};
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(5,12): error TS4113: This member cannot have an 'override' modifier because it is not declared in the base class 'Base'.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Correct the name to match the base class member.
- Remove
overrideif this is a new member.