homebridge-samsungtv-control2 icon indicating copy to clipboard operation
homebridge-samsungtv-control2 copied to clipboard

Does not work after updating to HB 1.3.0 - TypeError: Cannot read property 'log' of undefined

Open TheEngineerGuy opened this issue 4 years ago • 3 comments

TypeError: Cannot read property 'log' of undefined at debug (/usr/lib/node_modules/homebridge/src/logger.ts:143:10) at checkDeviceDetails (/usr/lib/node_modules/homebridge-samsungtv-control/src/utils/detectDevices.ts:85:5) at processTicksAndRejections (node:internal/process/task_queues:93:5)

This error causes HB to get stuck in a constant service restart loop.

Please advise.

EDIT:

  1. Uninstalled plugin - Everything starts working fine.
  2. Unpaired SamsungTV Bridge
  3. Removed Accessory
  4. Restarted HomeBridge - Everything still working fine
  5. Installed 'SamsungTv Control' plugin again - HB Restart loop starts again

TheEngineerGuy avatar Feb 21 '21 16:02 TheEngineerGuy

if I am not mistaken, looks like deviceChecks.push(checkDeviceDetails(headers, rinfo, log, config)) call in detectDevices.ts is creating this issue, as log is uninitiated here.

@mmende would you mind taking a look?

TheEngineerGuy avatar Feb 25 '21 04:02 TheEngineerGuy

same issue here New plugin installation, same issue on detectDevices

iperniaf avatar Mar 30 '21 12:03 iperniaf

@iperniaf don't think your code has been published yet in a new package.

For others facing the same issue please modify following file for now:

1. sudo nano /usr/lib/node_modules/homebridge-samsungtv-control/dist/utils/detectDevices.js
2. Scroll down till you see: logFn(chalk_1.default `Found unparsable model name ({red ${modelName}}) for device {blue ${friendlyName}}, usn: "{green ${usn}}". Skipping it.`);
3. Add // in front of it, and it should look like: //logFn(chalk_1.default `Found unparsable model name ({red ${modelName}}) for device {blue ${friendlyName}}, usn: "{green ${usn}}". Skipping it.`);

TheEngineerGuy avatar Apr 20 '21 22:04 TheEngineerGuy