How to fix Property 'x' does not exist on type 'Y' in TypeScript | DevErrors