TS2353

TS2353: Object literal may only specify known properties, and 'id' does not exist in type Omit<VideoEntity, 'id'>.

Broken Code ❌

return VideoEntity.new({
  ytCode: item.snippet!.resourceId!.videoId!,
  id: -1,
});

Solution:

In the broken code, you are trying to set the id property on an instance of VideoEntity where id has been explicitly removed from the permissible properties through the use of Omit<VideoEntity, 'id'>.

Remove the id property from the object literal since it has been omitted from the type definition you are trying to conform to.

Fixed Code ✔️

return VideoEntity.new({
  ytCode: item.snippet!.resourceId!.videoId!,
});