-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't run a script with ts-node that calls the render function #78
Comments
What am i missing of the issue template? I included a minimal reproduction repository link. |
yeah I originally dropped that comment from reading on my phone and for some reason the link did not render, I deleted that reply 😅 |
Okay 😅 |
I was able to reproduce it on my end using your repo.
And (with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table align="center" width="100%" role="presentation" cellspacing="0" cellpadding="0" border="0" style="max-width:37.5em">
<tbody>
<tr style="width:100%">
<td>Hello</td>
</tr>
</tbody>
</table>
</body>
</html> My hunch is that it's a |
Thanks for looking into this and the fast reply! I pushed a commit where i added a new command. It has nothing to do with ts-node, since it also fails if i run build and then run the compiled file with node directly. EDIT: i guess i could also use |
You could always try
Well it's definitely a node resolution problem. The CLI uses render just how you're using it in the script, and it works. A better workaround, though more leg work, is to install all of the packages separately, since it seems to also be an
The billion-packages setup is a holdover from when we forked from |
I also thought that was crazy with all the single packages from react-email ... |
My guess would be by end of week. We'll see how work and kids and stuff plays out. I'd recommend the individual packages approach bc it's newer stuff and capability that will be in the monopackage. |
@shellscape i updated everything to individual packages and it seems to work (i can run the script), but my last problem is now that my existing tests with jest are no longer working. I updated my example repo with a simple test case: https://github.com/co-sic/node-playground |
Jest is well-known to do weird things under the covers, like futzing with My efforts on the single package are getting closer to done, and you can try that out by installing |
Thx for recommending vitest, its working without any problems. Since i have all the templates in a dedicated package it is no problem to switch from jest :) |
Awesome! |
@shellscape i just updated to the new single package release and i now again get the error i posted in the original post here. I updated the playground example i linked in the orginal post. |
Have you tried |
Sorry forgot to test that. It works, so that fine for me 👍 |
Awesome. We'll add this to the FAQ on the docs |
@jsx-email/cli
Version?: 3.0.1https://github.com/co-sic/node-playground
Expected Behavior
I should be able to run the script
Actual Behavior
I get an error:
Additional Information
It runs no problem with v2.0.0 of jsx-email/all
The text was updated successfully, but these errors were encountered: