- Error
- Reported by the type checker
TS1184
Modifiers cannot appear here.
Modifiers are used where none are allowed at all, for example `static` on a method in an object literal.
What it means
Some positions accept no modifiers. ts-r-check reports this, for example, on the first modifier of an object-literal method (other than async), together with TS1042 for each modifier.
Example
export const o = { async static m() { return 1; } };
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(1,26): error TS1042: 'static' modifier cannot be used here.
index.ts(1,26): error TS1184: Modifiers cannot appear here.
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
- Remove the modifiers. In object literals only
asyncis allowed on methods.