🤔
How are you guaranteeing that the record exists? Undefined is neither in String nor LanguageKey, and I think that's what it's complaining about.
You can fix this by adding an empty check
...
const language = this.languages[langKey];
if(!language) throw Error();
this.needsString(language);
...