Skip to content

Errors in Cloudflare Workers environment with recent versions #64

@primeare

Description

@primeare

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 after 3.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:

  1. Use browser version of mimetext: import { createMimeMessage } from 'mimetext/browser';;
  2. Enable node_compat = true in wrangler.toml to turn on Node.js polyfills.

Error details in cloudflare/wrangler-action

Node.js version: 18.19.0
NPM version: 10.2.3

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions