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

TypeScript Error: Property 'connect' does not exist on type 'typeof Mailjet' in node-mailjet v6.x #284

Open
MamunsCrafts opened this issue Sep 24, 2024 · 3 comments

Comments

@MamunsCrafts
Copy link

MamunsCrafts commented Sep 24, 2024

import { Injectable, InternalServerErrorException } from '@nestjs/common';
import Mailjet from 'node-mailjet';
import ejs from 'ejs';
import { welcomeMailTemplate } from '../templates/welcome';

@Injectable()
export class EmailService {
private readonly mailjet: any;

constructor() {
this.mailjet = Mailjet.connect( // here connect not working . i also try apiConnect
process.env.MJ_APIKEY_PUBLIC || 'your-api-key',
process.env.MJ_APIKEY_PRIVATE || 'your-api-secret'
);
}

// Other methods...
}
I am trying this . but this error is showing always

@lassesbrt
Copy link

Same issue here.

@avciventures
Copy link

I have same issue either. Any resolve?

@MamunsCrafts
Copy link
Author

I took env variable inside string literal. then it solved

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

3 participants