GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

Sentiment node fails with msg.payload neither String nor Buffer #2

Closed kolban-google closed 5 years ago

kolban-google commented 5 years ago

When we pass a string into the sentiment node, it fails with an error of:

msg.payload neither String nor Buffer

kolban-google commented 5 years ago

Within the implementation of the node, we guard that we are passing a text string to the GCP natural language sentiment subsystem. Sadly, we got the logic of it wrong. We tested to see if it was an instanceof String but this is not sufficient. We must also check that it could be a typeof string. More details on string comparison can be found here.

The code change has been made in dev branch but not yet published. This issue will be closed once the publish has been completed.