TypeError: this.TTS.speak is not a function Ionic V4

I tried implementing text to speech functionality by following the ionic native tutorial but I get TypeError: this.TTS.speak is not a function when the function is called. Can some tell me what I am doing wrong please,Thanks

constructor(private TTS: TextToSpeech) {
  this.text = 'How are you'; 
  this.locale = 'en-us';
  this.rate = 1;

speakText = () =>{
    text: this.text,
    locale: this.locale,
    rate: this.rate,
    }).then(() => console.log('Success'))
    .catch((reason: any) => console.log(reason));

Probably failing to have an /ngx at the tail of your import of TTS.

You tagged this as a react question? But looks like angular…

Have you imported the TTS type and created a new one before using?

Might be able to help you spot the issue if you post all the code in that file.

Thanks, figured it out. went over the code and realized it was how I was importing the TTS in React so I removed the ."/ngx" and that fixed the issue.