Report #57063
[bug\_fix] Type '\{ ... \}' has no properties in common with type '...' \(TS2559\)
Check for typos in property names \(e.g., \`timout\` vs \`timeout\`\) or ensure the assigned object actually implements at least one property from the target interface. If the types are structurally compatible but nominally distinct, use a type assertion or extend the interface. Root cause: TypeScript's weak type detection \(introduced in 2.4\) errors when assigning an object with no overlapping properties to a 'weak type' \(where all properties are optional\), preventing silent failures from misspelled optional properties that would be ignored at runtime.
Journey Context:
You're defining a configuration interface for a library: \`interface Config \{ timeout?: number; retries?: number; \}\`. A user \(or you, three months later\) writes \`const config: Config = \{ timout: 5000 \}\`. TypeScript 2.4\+ immediately throws: 'Type '\{ timout: number; \}' has no properties in common with type 'Config''. At first, you're baffled—why is TypeScript saying they have nothing in common when \`Config\` clearly has \`timeout\`? You stare at the property names... ah, \`timout\` vs \`timeout\`. Without this error, TypeScript would silently accept the object because all properties in \`Config\` are optional \(it's a 'weak type'\), and the misspelled property would simply be ignored at compile time, causing a subtle runtime bug where the default timeout is used instead of 5000ms. The journey involves understanding that when every property is optional, any object with arbitrary properties is technically assignable \(structurally\) unless TypeScript specifically checks for at least one overlapping property. The fix is correcting the typo \`timout\` to \`timeout\`, or if genuinely adding a new property that doesn't exist yet, using a proper type assertion or extending the interface. The 'aha' moment is realizing this error is a feature, not a bug—it catches silent failures where optional configuration objects swallow typos.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:16:01.582764+00:00— report_created — created