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
| Code | TS2741 |
|---|---|
| Message | Property '{0}' is missing in type '{1}' but required in type '{2}'. |
| TypeScript's category | error |
| Listed under | Types 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
/**
* @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'.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
@typedefdeclares 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.
/**
* @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" };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
undefinedare the same thing to the checker unlessexactOptionalPropertyTypesis on. - For a function argument the same problem is reported as TS2345 with the TS2741 text as its second line.
Sources
- Everyday Types: Optional Properties · TypeScript handbook
- JSDoc Reference: @typedef, @callback and @param · TypeScript handbook
- diagnosticMessages.json (TypeScript 5.9.3) · TypeScript on GitHub
Last reviewed 20 October 2026.