Open primeare opened 7 months ago
hey @primeare they look like good solutions, and i think they should be in the readme under use section. create a pr if you wish or i will soon update the readme and include this.
ps: i will test the the library in cloudflare worker environment later and come up with a proper solution
I just use mimetext/browser
for this. Worker-d runs on web standards
Introduction
Cloudflare in their documentation propose to use
mimetext
for sending emails in their Cloudflare Workers and Cloudflare Email Workers.The problem
Since updating to version
3.0.21
(although it could be any version after3.0.16
, as it worked previously), the library does not work natively in the Cloudflare Workers environment. By saying natively, I mean without transpiling code or enabling Node.js compatibility modes or flags.Hotfix solution
Currently, I found two possible solutions:
mimetext
:import { createMimeMessage } from 'mimetext/browser';
;node_compat = true
inwrangler.toml
to turn on Node.js polyfills.Error details in
cloudflare/wrangler-action
Node.js version: 18.19.0 NPM version: 10.2.3