watson-developer-cloud / text-to-speech-nodejs

This is a deprecated Watson Text to Speech Service Demo. A link to the newly supported demo is below
https://www.ibm.com/demos/live/tts-demo/self-service/
Apache License 2.0
349 stars 273 forks source link

Text to Speech demo returns 500 error #111

Closed horiDemachiLab closed 5 years ago

horiDemachiLab commented 5 years ago

Overview I checked out demo project from https://github.com/watson-developer-cloud/text-to-speech-nodejs. I made .env file and input url and apikey that I got from my IBMCloud account. Then, run locally. Access from browser and click speak button. I got 500 error, and there were error message like screenshots. After few seconds error message disappear. I retried to click speak button, then run correctlly. I recognized that 500 error happens only first time when run localserver by "npm start".

Expected behavior Run locally, then click speak button first time, then run correctlly.

Actual behavior Run locally, then click speak button first time, there is 500 error and error message.

How to reproduce Checked out demo project from https://github.com/watson-developer-cloud/text-to-speech-nodejs. Follow the Readme and run locally, then click speak button.

Screenshots Before click speak button スクリーンショット 2019-06-04 10 38 58 After click speak button スクリーンショット 2019-06-04 10 39 19 Error message スクリーンショット 2019-06-04 10 23 52

Additional information:

jeff-arn commented 5 years ago

@horiDemachiLab thank you for the thorough bug report! I'm digging into this now, and can confirm that I can reproduce the issue as you have described it.

I'm looking into if there might be an issue with how the IAM key is provisioned.

Specifically, the bug is caused by https://github.com/watson-developer-cloud/text-to-speech-nodejs/blob/master/app.js#L53

The first time that GET /api/v1/synthesize's handler is called, transcript is undefined, so therefore assigning event handlers to it through transcript.on('response') creates an error.

I'll keep looking into it and hopefully will have a PR with a fix soon.

germanattanasio commented 5 years ago

This issue is fairly old and there hasn't been much activity on it. Closing, but please re-open if it still occurs.

nicomse commented 5 years ago

hey, im having exact the same problem

anesuc commented 4 years ago

Any progress on this? I am experiencing the same error