For Workers & Pages, what is the name of the domain?
.pages.dev
What is the error number?
none
What is the error message?
none
What is the issue or error you’re encountering
fetch(...Resend...)
is not working. No error caught nor console.log()
What are the steps to reproduce the issue?
After hundreds of tries I’m starting to think that fetch() doesn’t work on pages.
The code is pretty simple as shown below.
It works fine in my local environment got no problems.
But in pages
it just doesn’t work.
catch
doesn’t catch any errors, and nothing seems to work after fetch()
.
It just seems that fetch()
destroies the app without any error.
my code :
try { ... const res = await fetch('https://api.resend.com/emails', { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization:
Bearer ${env.RESEND_API_KEY} }, body: JSON.stringify(body), }) ... }
Or is there any alter way to send mail in pages?