We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2cfe468 commit f08e0feCopy full SHA for f08e0fe
.changeset/wet-planes-camp.md
@@ -0,0 +1,5 @@
1
+---
2
+"react-email": patch
3
4
+
5
+Add error message for when an email template does not have a default export
packages/react-email/src/utils/get-email-component.ts
@@ -106,6 +106,21 @@ export const getEmailComponent = async (
106
};
107
}
108
109
+ if (typeof parseResult.data.default !== 'function') {
110
+ return {
111
+ error: improveErrorWithSourceMap(
112
+ new Error(
113
+ `The email component at ${emailPath} does not contain a default exported function`,
114
+ {
115
+ cause: parseResult.error,
116
+ },
117
+ ),
118
+ emailPath,
119
+ sourceMapToEmail,
120
121
+ };
122
+ }
123
124
const { data: componentModule } = parseResult;
125
126
return {
0 commit comments