forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.64k stars 339 forks source link

Webpack 5, can't find template #422

Closed stevenmunro closed 3 years ago

stevenmunro commented 3 years ago

I upgraded Next.js to 10.2 and enabled Webpack 5. Emails functioning fine before upgrade (Webpack 4). After upgrade I get this error.

Error: No content was passed for subject, html, text, nor attachments message props. Check that the files for the template "quoteEmail" exist.


    at async Email.send (/var/task/node_modules/email-templates/lib/index.js:300:20)
2021-04-30T01:00:47.004Z    8a3122be-0afa-4e7f-b32b-71e72e09a647    ERROR   Error: No content was passed for subject, html, text, nor attachments message props. Check that the files for the template "quoteEmail" exist.
    at Email.renderAll (/var/task/node_modules/email-templates/lib/index.js:277:251)
    at async Email.send (/var/task/node_modules/email-templates/lib/index.js:300:20)

Any idea where to begin looking? I'm not using any custom webpack configuration.
stevenmunro commented 3 years ago

If I downgrade to Webpack 4 (and keep Next.js at 10.2), the emails work.

niftylettuce commented 3 years ago

If you have a PR to make to the README or a PR with tests or something let me know!