I had this error in a typescript method:

The error

error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.

The code

getPerson(): string {

}

Solution

If you declare a return type, you have to return something

getName(): string {
  return 'Stef';
}