You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix errors when running the preview server on the demo
This was mostly caused because `pnpm` doesn't allow for resolving
`@react-email/render` when only `@react-email/components` is installed
like npm or other package managers do.
The solution for this was overriding the resolution of the module to get
`renderAsync` from, and then trying both `@react-email/render` and
`@react-email/components` until it actually errors.
// If @react-email/render does not exist, resolve to @react-email/components
63
+
result=awaitb.resolve('@react-email/components',{
64
+
kind: 'import-statement',
65
+
importer: args.importer,
66
+
resolveDir: args.resolveDir,
67
+
namespace: args.namespace,
68
+
});
69
+
if(result.errors.length>0){
70
+
result.errors[0]!.text=
71
+
"Trying to resolve `renderAsync` from both `@react-email/render` and `@react-email/components` to be able to render your email template. Maybe you don't have the required dependencies installed?";
0 commit comments