TypeScript error

TS2561: An unknown property in an object literal, with a suggestion

  • Error TS2561
  • Tested with TypeScript 5.9

error TS2561: Object literal may only specify known properties, but 'retires' does not exist in type 'FetchOptions'. Did you mean to write 'retries'? is TS2353 with a suggestion: an object literal written straight into a typed place has a property the type does not declare, and a declared property is close enough in spelling for the checker to name it.

In plain JavaScript the misspelled option is simply ignored at run time, so a retry count, a timeout or a flag quietly keeps its default. In options objects and reducer actions, this is one of the most useful errors checked JavaScript reports.

At a glance

CodeTS2561
MessageObject literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?
TypeScript's categoryerror
Listed underTypes do not match
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

fetch.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: fetch.js(9,13): error TS2561: Object literal may only specify known properties, but 'retires' does not exist in type 'FetchOptions'. Did you mean to write 'retries'? 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. fetch.js(9,13): error TS2561: Object literal may only specify known properties, but 'retires' does not exist in type 'FetchOptions'. Did you mean to write 'retries'? 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. fetch.js(9,13): error TS2561: Object literal may only specify known properties, but 'retires' does not exist in type 'FetchOptions'. Did you mean to write 'retries'? checked 21 October 2026
/** @typedef {{ retries?: number, timeoutMs?: number }} FetchOptions */

/** @param {FetchOptions} options */
export function retriesOf(options) {
  return options.retries ?? 3;
}

retriesOf({ retires: 5 });error TS2561: Object literal may only specify known properties, but 'retires' does not exist in type 'FetchOptions'. Did you mean to write 'retries'?
A misspelled option in an object literal, with a suggestion.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["**/*.js"]
}

What causes it

  • A typo in an option or property name (retires for retries, timout for timeout).
  • A property renamed in the @typedef but not at every call site.

How to fix it

Use the name the checker suggests

Editors that run TypeScript's language service offer the rename as a quick fix. Check that the suggestion is the property you meant before accepting it.

fetch.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
/** @typedef {{ retries?: number, timeoutMs?: number }} FetchOptions */

/** @param {FetchOptions} options */
export function retriesOf(options) {
  return options.retries ?? 3;
}

retriesOf({ retries: 5 });
The option spelled as the type declares it.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["**/*.js"]
}

Or add the property to the type

If the property is real and the type is out of date, add it to the @typedef or the @param type, as for TS2353.

Gotchas

  • Like TS2353, the check applies only to object literals written in place. The same object stored in a variable first is not checked for extra properties, so the typo would pass silently.
  • With exactOptionalPropertyTypes or a cast (/** @type {FetchOptions} */ ({ … })), the rules change: a cast skips the excess property check entirely.

Sources

Last reviewed 21 October 2026.