Cannot destructure property 'templateName' of 'precompile(...)' as it is undefined.
See original GitHub issueI created a separate mail module located on src/mail/mail.module.ts
MailerModule.forRoot({ transport: { host: 'localhost', port: 1025, secure: true, auth: { user: 'hi', pass: 'hi' }, }, defaults: { from: '"Admin" <admin@localhost.com>' }, template: { dir: process.cwd() + '/templates', adapter: new HandlebarsAdapter(), options: { strict: true }, }, })
my template is src/mail/templates/auth/signup-success.html.hbs
this is my service
await this.mailService.sendMail({ to: userMail, subject: 'Welcome to our app', template: '/auth/signup-success.html', context: { name: 'MyName', }, })
I configure my nest-cli.json
"compilerOptions": { "assets": ["mail/templates/**/*.hbs"], "watchAssets": true }
I don’t know what to use process.cwd() / __dirname.
I don’t know what developer do here, I try 25 different combination, every-time I get this err.
I ask, how to include .hbs file that just work.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Related StackOverflow Question
please, use v1.7.0
This bug is already fixed by #743 , but there is no new release with this fix 🙈