- Error
- Reported by the tsconfig loader
- Reported by the lexer and parser
TS1136
Property assignment expected.
Inside an object literal, the parser expected a property (`name: value`, a method or a spread) but found another token.
What it means
An object literal contains properties, shorthand properties, methods, accessors and ... spreads, separated by commas. This is reported when an entry starts with a token that can't begin any of these. It's also reported by ts-r's tsconfig.json reader for malformed JSON objects.
Example
export const o = { a: 1, + };
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(1,26): error TS1136: Property assignment expected.
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 stray token or finish the property:
{ a: 1, b: 2 }.