Sending email with Resend from a Pages instance

Is it possible to use Resend with Pages? It sounds like people are successfully doing this, but I must be missing something. I followed the instructions here: https://developers.cloudflare.com/workers/tutorials/send-emails-with-resend/#enable-mailchannels-for-your-account---domain-lockdown I've got this on line 1 of my function:
import { Resend } from 'resend';
import { Resend } from 'resend';
But my deployments fail with
ERROR: Could not resolve "resend"
ERROR: Could not resolve "resend"
This makes me think either Resend is not supported, or I'm missing something very simple here.
Cloudflare Docs
Send Emails With Resend · Cloudflare Workers docs
All of the tutorials assume you have already completed the Get started guide, which gets you set up with a Cloudflare Workers account, C3 , and …
4 Replies
tmcltr
tmcltrOP•8mo ago
All the docs I've found for this seem to be about Workers, not Pages Functions.
Vero
Vero•7mo ago
Hey. Have you followed the final step?
No description
tmcltr
tmcltrOP•7mo ago
Hmm maybe the problem is that I don't typically set up a localhost environment for these. I deploy to a preview/stage branch and use that for development/testing. So installing node modules locally didn't seem necessary. But now that I think about it, maybe that's the part I'm missing!
Vero
Vero•7mo ago
Great, then it should work 🙂
Want results from more Discord servers?
Add your server