How to fix Type 'any' is not assignable to type 'never' in TypeScript | DevErrors