How to fix Argument type 'never' is not compatible with parameter type in TypeScript | DevErrors