Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.11 breaks backward compatibility #1127

Open
JonnyBGod opened this issue Feb 29, 2024 · 7 comments
Open

1.11 breaks backward compatibility #1127

JonnyBGod opened this issue Feb 29, 2024 · 7 comments

Comments

@JonnyBGod
Copy link

Describe the bug
After upgrading to 1.11 or later it faills compilation while using either 'nodemailer-mandrill-transport' or 'nodemailer-mailgun-transport'.

To Reproduce

import mandrillTransport from 'nodemailer-mandrill-transport'

const transport = mandrillTransport({
  auth: {
    apiKey: 'MANDRILL_KEY',
  },
})

Expected behavior
It should not break compatibility with older transports that use callbacks intead of promises

Additional context

[ExceptionHandler] transporter.verify(...).then is not a function TypeError: transporter.verify(...).then is not a function
    at MailerService.verifyTransporter (/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:67:14)
    at new MailerService (/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:60:18)
    at Injector.instantiateClass (/node_modules/@nestjs/core/injector/injector.js:365:19)
    at callback (/node_modules/@nestjs/core/injector/injector.js:65:45)
    at Injector.resolveConstructorParams (/node_modules/@nestjs/core/injector/injector.js:144:24)
    at Injector.loadInstance (/node_modules/@nestjs/core/injector/injector.js:70:13)
    at Injector.loadProvider (/node_modules/@nestjs/core/injector/injector.js:97:9)
    at /node_modules/@nestjs/core/injector/instance-loader.js:56:13
    at async Promise.all (index 4)
    at InstanceLoader.createInstancesOfProviders (/node_modules/@nestjs/core/injector/instance-loader.js:55:9)
    at /node_modules/@nestjs/core/injector/instance-loader.js:40:13
    at async Promise.all (index 43)
    at InstanceLoader.createInstances (/node_modules/@nestjs/core/injector/instance-loader.js:39:9)
    at InstanceLoader.createInstancesOfDependencies (/node_modules/@nestjs/core/injector/instance-loader.js:22:13)
    at /node_modules/@nestjs/core/nest-factory.js:108:17
    at Function.asyncRun (/node_modules/@nestjs/core/errors/exceptions-zone.js:22:13) 
@domme1908
Copy link

Yea I can confirm this. Upon updating 1.11.2 i get the following error upon startup:
[Nest] 44016 - 29.02.2024, 21:34:11 ERROR [MailerService] Transporter is ready
I am not using any custom transport though.

@DocAmaroo
Copy link

I can confirm too, my application used SendMailTransport and I received the same errors.

I removed it to use simple object config and I discovered the same error message that @domme1908 referred (see comment above ↑)

@randbytes
Copy link

randbytes commented Mar 2, 2024

Why I always receiving [MailerService] Transporter is ready ?

@Mosheng-Yan
Copy link

Me too, please tell me how to solve it?

@gterras
Copy link

gterras commented Mar 4, 2024

About the phantom Transporter is ready this is probably triggered here :

public async verifyAllTransporters() {
const transporters = [...this.transporters.values(), this.transporter];

Since this.transporter is added unconditionally.

@aecuto
Copy link

aecuto commented Mar 8, 2024

@GFoniX bug!!! verify from #1118

@GFoniX
Copy link

GFoniX commented Mar 8, 2024

Fixed in this PR #1133. Sorry for this inconvenience, I had indeed run npm run test but not with SendGrid. Now, the test has become "optional," and I have added an additional check just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants