nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
863 stars 147 forks source link

Node.js v20, v18 fail on smtp-stream #197

Closed fosron closed 1 year ago

fosron commented 1 year ago

Can't run smtp-server on Node.js v20, v18 versions

[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node .`
/Users/.../node_modules/smtp-server/lib/smtp-stream.js:34
        this.closed = false;
                    ^

TypeError: Cannot set property closed of #<Writable> which has only a getter
    at new SMTPStream (/Users/.../node_modules/smtp-server/lib/smtp-stream.js:34:21)
    at new SMTPConnection (/Users/.../node_modules/smtp-server/lib/smtp-connection.js:55:24)
    at SMTPServer.connect (/Users/.../node_modules/smtp-server/lib/smtp-server.js:93:26)
    at /Users/.../smtp-server/lib/smtp-server.js:84:26
    at Immediate.<anonymous> (/Users/.../node_modules/smtp-server/lib/smtp-server.js:345:39)
    at process.processImmediate (node:internal/timers:478:21)

seems that internal changes require a refactor regarding this.

Is there a plan for it, would the refactor be accepted if we made a PR?

fosron commented 1 year ago

Ok npm update seems to have it solved