Skip to content

Commit 2373066

Browse files
authored
fix(trigger): await async react-email render in HN summary (#64)
- Use await render() for Resend HTML body (AI SDK / react-email types) - TypeScript config tweaks from Next build Made-with: Cursor
1 parent df1438b commit 2373066

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

examples/integrations/trigger/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

examples/integrations/trigger/src/trigger/summarize-hn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const summarizeHackerNews = schedules.task({
6262
from: "Hacker News Summary <hi@demo.tgr.dev>",
6363
to: ["james@trigger.dev"],
6464
subject: "Your morning HN summary",
65-
html: render(<HNSummaryEmail articles={summaries} />),
65+
html: await render(<HNSummaryEmail articles={summaries} />),
6666
});
6767

6868
logger.info("Email sent successfully");

examples/integrations/trigger/tsconfig.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"compilerOptions": {
3-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
48
"allowJs": true,
59
"skipLibCheck": true,
610
"strict": true,
@@ -18,8 +22,11 @@
1822
}
1923
],
2024
"paths": {
21-
"@/*": ["./src/*"]
22-
}
25+
"@/*": [
26+
"./src/*"
27+
]
28+
},
29+
"target": "ES2017"
2330
},
2431
"include": [
2532
"next-env.d.ts",
@@ -28,5 +35,7 @@
2835
".next/types/**/*.ts",
2936
"trigger.config.ts"
3037
],
31-
"exclude": ["node_modules"]
38+
"exclude": [
39+
"node_modules"
40+
]
3241
}

0 commit comments

Comments
 (0)