Next.js Discord

Discord Forum

Idk how to fix this error :/

Unanswered
Banana posted this in #help-forum
Open in Discord
Error:
Type '({ token }: { req: PayloadRequest; token: string; user: any; }) => Element' is not assignable to type 'GenerateVerifyEmailHTML'.
  Type 'Element' is not assignable to type 'string | Promise<string>'.


Code Snippet:
            generateEmailHTML: ({token}) => {
                return PrimaryActionEmailHtml({
                    actionLabel: "Verify your account",
                    href: `${process.env.NEXT_PUBLIC_SERVER_URL}/verify-email?token=${token}`
              

(Im using payloadCMS)

3 Replies

bump
Laysan Albatross
thats an issue with your typing (typescript). You defined the type string for token but it receives something with the type Element.