-
Notifications
You must be signed in to change notification settings - Fork 107
TypeError: Cannot read properties of undefined (reading 'login') #296
Description
Describe the bug
I updated bluelinkey in node-red from 0.0.30 to 0.0.32. I had to restart node-red to activate some upgraded modules, including BlueLinkey. (That was because every other day or so, it dit not get any data from the vehicle, until I changed the language in de node and it worked for a short while. The Get Status node had the green dot. But I think I solved that by adding a login node that ires every 10 minutes.) I t was not the right moment to restart node-red, so I waited some time and today I restarted NR from the command prompt. (Normally it starts with the server reboot.)
It crashed with this message:
[error] TypeError: Cannot read properties of undefined (reading 'login')
at Login._inputCallback (C:\Users\XXX.node-red\node_modules\node-red-contrib-bluelinky\bluelinky.js:503:14)
at C:\Users\XXX\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\runtime\lib\nodes\Node.js:210:26
at Object.trigger (C:\Users\XXX\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\util\lib\hooks.js:166:13)
at Login.Node._emitInput (C:\Users\XXX\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\runtime\lib\nodes\Node.js:202:11)
at Login.Node.emit (C:\Users\XXX\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\runtime\lib\nodes\Node.js:186:25)
at Login.Node.receive (C:\Users\XXX\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\runtime\lib\nodes\Node.js:485:10)
at Immediate. (C:\Users\XXX\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\runtime\lib\flows\Flow.js:831:52)
at processImmediate (node:internal/timers:476:21)
Usefull info(please complete the following information):
- OS: Windows Server 2019
- Bluelinky Version 0.0.32
- Region: EU
- Brand: hyundai
- Node-red version 3.0.2
- Node.js version 18.16.0
Additional context
As I use it to get the SOC of the car, the login is started at NR starup, so I could not edit the flow. I commented the line in error for the moment. Bluelinkey fails, but does not crash node-red.
function Login(config) {
RED.nodes.createNode(this, config);
this.bluelinkyConfig = RED.nodes.getNode(config.bluelinky);
this.on('input', async function (msg) {
State.emit('changed', { fill: 'grey', shape: 'ring', text: 'Logging in...' });
//client.login(); <== line with error
});
}
Metadata
Metadata
Assignees
Labels
Projects
Status