Error related to jsx-email ✘ [ERROR] Could not resolve "path"
I just recently updated my packages and installed jsx-email and now I am getting this error bellow:
I think that this is happening in my email.ts file, I tried adding
'use node';
but then I get:
Here is the source code of my email.ts
:
https://pastebin.com/raw/eFcUZUYB
Is it possible to resolve this if so how?6 Replies
This is certainly related to the
jsx-email
package as when I remove it it is successfull:it looks like jsx-email is not supported in browser/deno-like environments https://www.npmjs.com/package/jsx-email ; it only works in node. to use it in convex you should only use it in actions and put
"use node";
at the top of the file.npm
jsx-email
Render JSX email components to HTML email. Latest version: 1.12.1, last published: 5 hours ago. Start using jsx-email in your project by running
npm i jsx-email
. There are no other projects in the npm registry using jsx-email.I have
'use node';
at the top of my file and it is an internal action.
Oh, sorry, turns out I did not have 'use node';
in one of the files that use the jsx-email
.
Is it possible to automatically add it to files that use the jsx-email
or something?It's not unfortunately. You have to tell Convex which runtime you want to use.
Okay, thanks.