Overview
- Bug Type:
- Type/nullability drift
- Category:
- Interface & Contract
Definition
Declared types or nullability guarantees diverge between components/services, causing runtime null/type errors.
How to fix Type/nullability drift?
Enable strict typing; sync contracts; validate at boundaries; add guards for optional fields; regenerate and pin client/server types
Symptoms
Observable signs that may indicate Type/nullability drift:
- Runtime errors where types claim non-null but values are null/undefined.
- Compilation passes but runtime fails on property access.
- API responses omit fields expected as required in client types.
Example Errors:
- Cannot read properties of undefined (reading 'x')
- TypeError: null is not an object
- TS2322: Type 'undefined' is not assignable to type 'T'
