Required property 'text' is missing from docs example
arifire21 opened this issue · 2 comments
arifire21 commented
Following the instructions from the Next.js introduction, when I paste in the data
block as it is in the example:
const data = await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'Hello world',
react: EmailTemplate({ firstName: 'John' }),
});
I get an error that the text
property is missing. Adding it to the list removes the error.
Argument of type '{ from: string; to: string[]; subject: string; react: ReactNode; }' is not assignable to parameter of type 'CreateEmailOptions'.
Type '{ from: string; to: string[]; subject: string; react: ReactNode; }' is not assignable to type 'Required<Pick<EmailRenderOptions, "text">> & Partial<Pick<EmailRenderOptions, "react" | "html">> & CreateEmailBaseOptions'.
Property 'text' is missing in type '{ from: string; to: string[]; subject: string; react: ReactNode; }' but required in type 'Required<Pick<EmailRenderOptions, "text">>'.ts(2345)
index.d.ts(159, 5): 'text' is declared here.
bukinoshita commented
Which version of the SDK you're using? Please, try upgrading to the latest
arifire21 commented
using npm install resend
(at the time of making the issue), package.json lists ^3.2.0