Use jsx-email within convex
jsx-email has
clean-css
as a dependency that throws an error within the convex environment. I'm using this in convex actions with use node
at the top of the file but no luck.
Any idea how to get past this would be appreciated5 Replies
The action file
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
@sshader 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
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 topIt worked, thank you very much @sshader . I had another file that was importing the component