Heroku issue with NodeMailer

前端 未结 2 1153
-上瘾入骨i
-上瘾入骨i 2021-02-04 19:23

I am having an issue with Nodemailer on Heroku and I would really appreciate your help.

A previous version of my application used to work on Heroku with no problem and w

2条回答
  •  死守一世寂寞
    2021-02-04 20:08

    I just got the following response back from Nodemailer:

    You are probably running Nodemailer in iojs. Only the latest version of Nodemailer is suported in node 0.12 and iojs, so you should either upgrade or fix the line 918 yourself like this:

    if(this._xoauth2){
        this._xoauth2.reconnectCount = 0;
    }
    

    Setting properties to boolean values was allowed in ES5 but iojs runs ES6 and trying to set a property in ES6 strict mode throws an error.

    I think I have fixed this by by explicitly setting the node.js version in my package file to an older version that uses ES5.

    This has fixed my problem. Lesson learned is to always set the nodejs version in the package file otherwise Heroku uses the latest version and it may be incompatible with your modules.

    Many thanks to Nodemailer, they got back to me super quick with a great response.

    Hopefully this will help someone else.

    Thanks.

提交回复
热议问题