-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working on serverless edge functions #1623
Comments
So we can't use nodemailer with nextjs? |
Sure you can use it as long as you dont deploy on Edge Workers |
Nodemailer does not work in any kind of Workers, only in "real" node.js. |
This is exactly the point of this issue |
The runtime for workers is not Node.js, it is more similar to a front-end runtime. That runtime lacks support for raw TCP and TLS APIs required by Nodemailer and as such Nodemailer will never work on it. |
For example the Cloudflare runtime certainly has limitations. What works is using the APIs (SES, SendGrid, Mailchannels) directly. |
@andris9 net is supported now using the flag: node_compat = true in wrangler.toml |
Seems like nodemailer is not working on edge functions like Cloudflare Workers, Vercel Edge Functions or Deno Deploy.
On Vercel I dont see a very detailed error:
Probably this is due to Node api being used like 'fs' that does not exist within edge worker functions.
As a workaround instead of nodemailer an external service like resend.com could be used: https://github.com/resend/resend-cloudflare-workers-example/blob/main/worker.js
Related: #1621 #1563
The text was updated successfully, but these errors were encountered: