オプショナルプロパティ(?)など undefined になりうる値を、確認せずに使うと出ます。
出るコード
type User = { name: string; nickname?: string };
const user: User = { name: "Aoi" };
console.log(user.nickname.length); // nickname は無いかもしれない
エラーメッセージ
error TS18048: 'user.nickname' is possibly 'undefined'.
直し方
if (user.nickname) { ... } で確認するか、オプショナルチェーン user.nickname?.length を使います。