watson-developer-cloud / node-red-node-watson

A collection of nodes for the IBM Watson services
Apache License 2.0
82 stars 86 forks source link

text-to-speech nodes appear stuck reading credentials of bound IAM service #450

Closed timroster closed 5 years ago

timroster commented 5 years ago

In Node-RED watson speech nodes added to flow fail to become operational. Opening Node panel for text-to-speech reveals message (which never goes away):

image

In Manage palette panel Nodes tab for the node-red-node-watson item an error message is shown:

Error: Cannot find module 'watson-developer-cloud/iam-token-manager/v1' (line:31)

This file (referenced in services/speech-to-text/v1.js) appears to have been removed in https://github.com/watson-developer-cloud/node-sdk/pull/845 and since the package.json for this repository specifies: "watson-developer-cloud": "^3.15.0" the latest 3.18.2 version is used, which has removed this file.

This may not be the root cause of the breaking text-to-speech node, but it likely is breaking speech-to-text.

Other nodes like language-translator appear to correctly read credentials from bound IAM-based services and function correctly.

timroster commented 5 years ago

The text-to-speech node also gets stuck this way when there is no watson service instance bound to the application.

timroster commented 5 years ago

The browser debug console is showing a message:

oneditprepare 63f2dbbf.541bb4 watson-text-to-speech ReferenceError: stt is not defined red.min.js:16

When opening the panel for the text-to-speech node. With the speech-to-text node affected by the change to the SDK, perhaps this reference us causing text-to-speech to also be affected.

This appears to be happening because line 450 in https://github.com/watson-developer-cloud/node-red-node-watson/blob/master/services/text_to_speech/v1.html contains (likely an copy/paste error)

    if (!stt.models) {
   ...

Probably should be tts.

chughts commented 5 years ago

It is STT that is effected by the drop of watson-developer-cloud/iam-token-manager from a minor release without a deprecation notice - IMHO not a nice thing to do to dependants.

The knock - on the tts is due to a bug in text_to_speech/v1.html as you have spotted.

chughts commented 5 years ago

Fixed in 0.7.6 awaiting release