TheNinjrKillrT
Convex Communityโ€ข2y agoโ€ข
2 replies
TheNinjrKillr

Nodemailer as external package not working

Hi all!

I have a project using nodemailer in a Node Action environment, but I'm getting this error:

โœ˜ [ERROR] Could not resolve "nodemailer"
convex/node_emails.ts:6:28:
6 โ”‚ import * as nodemailer from "nodemailer";
You can mark the path "nodemailer" as external to exclude it from the bundle, which will remove this error.

./convex.json
{
  "node": {
    "externalPackages": ["nodemailer"]
  }
}


convex/node_emails.ts
"use node";

import { v } from "convex/values";
import { action, internalAction, internalQuery } from "./_generated/server";

import * as nodemailer from "nodemailer";
import { MailOptions } from "nodemailer/lib/json-transport";


What am I missing? It's got to be something obvious ๐Ÿ˜…
Was this page helpful?