Skip to content

Node mailer giving error while using with hydrogen #3032

Answered by paul-phan
aswanth-updot asked this question in Help
Discussion options

You must be logged in to vote

Hello,

This error occurs because Hydrogen is designed to run in environments like MiniOxygen or Cloudflare Workers, which differ fundamentally from Node.js. These platforms do not support Node.js built-in modules or the CommonJS module pattern (require) and instead rely entirely on ES modules (import/export). Even if you resolve the import issue, Nodemailer and similar packages depend on APIs that are simply not available in these edge/serverless contexts.

Recommended Approach:

To send transactional emails from a Hydrogen application running on MiniOxygen or Cloudflare Workers, it is best to use an email provider that exposes an HTTP API—such as Mailgun, Postmark, SendGrid, or Resend—and …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@aswanth-updot
Comment options

Answer selected by aswanth-updot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants