Hi all,
I created a simple backend function for sending emails as so:
import { Email, emailSender } from 'wasp/server/email';
export const sendEmail = async (to: string, subject: string, text: string, html: string) => {
const emailToSend: Email = {
to,
subject,
text,
html,
};
await emailSender.send(emailToSend);
}
and call it from teh frontend
import { sendEmail } from './sendEmail';
...
await sendEmail(to, subject, stripHtml(message), message);
However, on page load, it crashes with the error
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/mailgun__js.js?v=3002b96a' does not provide an export named 'default' (at mailgun.ts:1:8)
Why does this happen? Am I not implementing it correctly?