How to fix Type 'unknown' is not assignable to type 'string' in TypeScript | DevErrors