Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-red-node-twitter unable to tweet - "TypeError: msg.payload.slice is not a function" #666

Closed
PlkMarudny opened this issue Jul 27, 2020 · 9 comments

Comments

@PlkMarudny
Copy link

Which node are you reporting an issue on?

Node-Red-Node-Twitter
What are the steps to reproduce?

Open an node red project
Install Node-Red-Node-Twitter
Insert a node twitter out
Configure credentials
Add a simple inject node with a timestamp
Connect inject node to twitter node
Deploy
Inject information to twitter node

What happens?

A message "TypeError: msg.payload.slice is not a function" displays in debug tab
What do you expect to happen?

Tweet "timestamp" in the account configured
Please tell us about your environment:

Node-RED version: v1.0.6
node.js version: v12.18.2
Platform/OS:Windows 2016 Server

@PlkMarudny PlkMarudny changed the title node-red-node-twitter unable to tweet node-red-node-twitter unable to tweet - "TypeError: msg.payload.slice is not a function" Jul 27, 2020
@knolleary
Copy link
Member

This is because the payload you are passing in is not a String type - which is what the node is expecting.

The node could do a better job with non-String types, but typically, you'd be tweeting an actual message and not just a number.

@PlkMarudny
Copy link
Author

PlkMarudny commented Jul 27, 2020

Well, after changing the timestamp to string, I am getting: "Missing required parameter: status."

@knolleary
Copy link
Member

You've changed it to String, but have you entered any text to tweet?

@PlkMarudny
Copy link
Author

Of course I did. In fact, this is just a test setup, as a production system failed with the same error (and it has been functioning for some time).

@knolleary
Copy link
Member

Of course I did.

I can't assume anything - I can only go by what is reported in the issue and it would have been a simple mistake to have switched from timestamp to string, leaving it blank and thus giving no status for the tweet and lead to the error message.

a production system failed with the same error (and it has been functioning for some time).

Did that fail with the timestamp-related error (msg.payload.slide is not a function) that you originally reported, or the 'missing required parameter' error?

@PlkMarudny
Copy link
Author

On the production (and in a simple "inject a string" it fails with "Missing required parameter: status." error.

@knolleary
Copy link
Member

So what else can you tell us about the production failure? You say it had been functioning for some time - does that mean it just started to report this error suddenly? Had anything changed in the environment? Was anything upgraded or changed? Were the flows modified to change what is passed to the node?

What version of the twitter node have you got installed?

@PlkMarudny
Copy link
Author

This is sth similar to #665 as if. What is the way to debug the node?

@PlkMarudny
Copy link
Author

Looking at the source code, looks like I was not setting the parameter correctly, however I did. Ok, this was strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants