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?