#Use jsx-email within convex
6 messages · Page 1 of 1 (latest)
I'd double check that there are no other files importing jsx-email without the "use node" at the top. I'd also check that there are no files without "use node" that import from the files that import from jsx-email
@frozen copper I have an action with use node that calls a mailer function with use node. In this mailer function file is where I imported jsx-email. jsx-email is a node library.
I have use node from the action file to the file that impors the library.
So to confirm, convex/lib/mails/summary.tsx is the only Convex file that imports jsx-email and convex/routes/sessionSummary/internal_actions.ts is the only Convex file that imports convex/lib/mails/summary.tsx? And both have "use node" at the top?
FWIW I can reproduce your original issue with this code
import { action } from "./_generated/server";
import { render } from "jsx-email"
export default action({
handler: async (_ctx, _args) => {
// log it so the bundler doesn't remove the import
console.log(render)
return null
}
})
But use node fixes it, so I suspect that we're accidentally importing jsx-email indirectly from a file that does not have use node at the top