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

Object #<holdNode> has no method 'context' #2

Open
ghost opened this issue Jun 13, 2016 · 4 comments
Open

Object #<holdNode> has no method 'context' #2

ghost opened this issue Jun 13, 2016 · 4 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jun 13, 2016

Hello sir,

After adding your node to Node-Red, when the flow is initiated, I've got this error in the log :
[error] [hold:c1d58113.722ee8] TypeError: Object # has no method 'context'

I'm using Node-RED on a Multitech Conduit AEP and I'm starting to be afraid to reach the limitation of this model ... I would like to know if a specific version of Node-RED is required and a specific version of node.js too ...

Regards,
Quentin Bossard

@ghost
Copy link
Author

ghost commented Jun 13, 2016

I've just checked, my version of Node-RED is v0.11.1. To get rid of this error, I took off all the parenthesis. Now, I've got a new error "[error] [hold:c1d58113.722ee8] TypeError: Cannot read property 'storedmessage' of undefined" I'm trying to get rid of this one too.

Regards,
Quentin Bossard

@ghost
Copy link
Author

ghost commented Jun 13, 2016

And to get rid of this one, I simply changed all the "node.context.storedmessage" to "msgtosend". Giving this as the new hold.js :
module.exports = function(RED) { "use strict"; function holdNode(n) { RED.nodes.createNode(this,n); var node = this; var msg = new Array(6); var msgtosend = new Array(6); msg = msg || null; this.on('input', function (msg) { if ((msg.trigger==null)||(msg.trigger!=true)) { msgtosend = msg; } else { if(msgtosend!=null) { node.send(msgtosend); } else { node.warn("Hold '"+n.name+"' triggered without message in buffer."); } } }); } RED.nodes.registerType("hold",holdNode); }

Regards,
Quentin Bossard

@renzenicolai renzenicolai added this to the 1.1 milestone Mar 20, 2021
@renzenicolai
Copy link
Owner

Thank you for reporting this issue, I will look into this as soon as I'm able to. I only have a limited amount of time available to work on projects like this one, so it might take a while for me to actually get around to putting in the effort.

PRs are always welcome, if you happen to find a solution yourself I'd be glad to merge your changes.

@renzenicolai
Copy link
Owner

Hmm, I see now that you've proposed a solution in your latest comment already... I will play around with that solution as soon as I can and merge it if it works 😄

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

No branches or pull requests

1 participant