TypeScript error

TS2741: An object is missing a required property

  • Error TS2741
  • Tested with TypeScript 5.9

error TS2741: Property 'price' is missing in type '{ sku: string; name: string; }' but required in type 'Product'. is reported when an object is used as a type that requires a property the object does not have. When two or more are missing the checker lists them instead, as TS2739.

In JSDoc every property of a @typedef is required unless you say otherwise, just as in a TypeScript interface. The error points at the variable (or argument) whose object falls short.

At a glance

CodeTS2741
MessageProperty '{0}' is missing in type '{1}' but required in type '{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

product.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: product.js(10,14): error TS2741: Property 'price' is missing in type '{ sku: string; name: string; }' but required in type 'Product'. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. product.js(10,14): error TS2741: Property 'price' is missing in type '{ sku: string; name: string; }' but required in type 'Product'. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. product.js(10,14): error TS2741: Property 'price' is missing in type '{ sku: string; name: string; }' but required in type 'Product'. checked 21 October 2026
/**
 * @typedef {object} Product
 * @property {string} sku
 * @property {string} name
 * @property {number} price
 */

/** @type {Product} */
export const mug = { sku: "MUG-01", name: "Enamel mug" };error TS2741: Property 'price' is missing in type '{ sku: string; name: string; }' but required in type 'Product'.
An object without one of the type's required properties.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

What causes it

  • The object really is incomplete: a property was forgotten or not loaded yet.
  • The property is optional in practice but the @typedef declares it as required.

How to fix it

Give the property a value

If the type is right, complete the object. The quick fix Add missing properties in editors that run TypeScript's language service writes the missing names with placeholder values.

product.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 {object} Product
 * @property {string} sku
 * @property {string} name
 * @property {number} price
 */

/** @type {Product} */
export const mug = { sku: "MUG-01", name: "Enamel mug", price: 12 };

/**
 * @typedef {object} Draft
 * @property {string} sku
 * @property {string} name
 * @property {number} [price] Not set until the product is priced.
 */

/** @type {Draft} */
export const draft = { sku: "MUG-02", name: "Travel mug" };
Give the property a value, or mark it optional.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

Or mark the property optional

Put the property name in brackets in its @property tag, @property {number} [price], or add a question mark in an inline type, { price?: number }. Code that reads the property then has to handle undefined, which is the point: the type now says the value may be absent.

Gotchas

  • A property that may be absent and a property that is present but undefined are the same thing to the checker unless exactOptionalPropertyTypes is on.
  • For a function argument the same problem is reported as TS2345 with the TS2741 text as its second line.

Sources

Last reviewed 20 October 2026.