Resend email not working with TanStack Start
I want to use Resend and react email to send email verification when I sign up using better auth, but I can't make it work in tanstack start. Neither Server Functions nor Server Routes were able to send email.
3 Replies
vicious-gold•2w ago
do you get any error? as it stands, your issue wont be solvable without a lot more context
wise-whiteOP•2w ago
I can't use the react prop (commented-out code), I have this error:
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
but the html prop works, VerifyEmail is using react email components
so, how do I render a react component in a server function?

sunny-green•2w ago
Have you tried converting to html and passing html to Resend instead? Assuming you're using react.email, so something like this: