Sunoo / homebridge-smtp-motion

Converts SMTP messages into HTTP motion alerts that homebridge-camera-ffmpeg understands
BSD 2-Clause "Simplified" License
9 stars 3 forks source link

TypeError: Cannot set property closed of #<Writable> which has only a getter #161

Closed Monofin closed 1 year ago

Monofin commented 2 years ago

After updating to Node 18.xx with Homebridge v1.5.1 (HAP v0.10.4), I get a crash on receipt of an email: previously this was all working well:

/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-stream.js:34 this.closed = false; ^ TypeError: Cannot set property closed of # which has only a getter at new SMTPStream (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-stream.js:34:21) at new SMTPConnection (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-connection.js:55:24) at SMTPServer.connect (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-server.js:93:26) at /usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-server.js:84:26 at Immediate. (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-server.js:345:39) at processImmediate (node:internal/timers:471:21) [31/10/2022, 19:58:35] [SMTP Motion] Child bridge process ended [31/10/2022, 19:58:35] [SMTP Motion] Process Ended. Code: 1, Signal: null [31/10/2022, 19:58:42] [SMTP Motion] Restarting Process... [31/10/2022, 19:58:43] [SMTP Motion] Launched child bridge with PID 1945966 [31/10/2022, 19:58:43] Registering platform 'homebridge-smtp-motion.smtpMotion' [31/10/2022, 19:58:43] [SMTP Motion] Loaded homebridge-smtp-motion v1.2.1 child bridge successfully [31/10/2022, 19:58:43] Loaded 0 cached accessories from cachedAccessories.0EDE28255D8B. [31/10/2022, 19:58:43] Homebridge v1.5.1 (HAP v0.10.4) (SMTP Motion) is running on port 39693.

Monofin commented 2 years ago

Further occurrence if the above set is removed (for reference): /usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-connection.js:325 this._parser.closed = true; ^ TypeError: Cannot set property closed of # which has only a getter at SMTPConnection._onClose (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-connection.js:325:33) at SMTPConnection._onCloseEvent (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-connection.js:316:14) at Socket. (/usr/lib/node_modules/homebridge-smtp-motion/node_modules/smtp-server/lib/smtp-connection.js:291:51) at Socket.emit (node:events:513:28) at TCP. (node:net:313:12)

massicottem commented 1 year ago

Updating the package smtp-server to the latest version (3.11.0) seems to fix the problem on my side. 🧐

Sunoo commented 1 year ago

I’ll try to push a new release with that package updated soon.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.