Skip to content

fix(miniflare): expose send_email in platform proxy#13723

Open
edmundhung wants to merge 2 commits intomainfrom
fix/send-email-platform-proxy
Open

fix(miniflare): expose send_email in platform proxy#13723
edmundhung wants to merge 2 commits intomainfrom
fix/send-email-platform-proxy

Conversation

@edmundhung
Copy link
Copy Markdown
Member

@edmundhung edmundhung commented Apr 29, 2026

Fixes #13715

This was not originally supported because email bindings relied on the EmailMessage class from cloudflare:email module, which is not available in the Node environment. Now that send_email supports the plain-object MessageBuilder interface, I think we should be able to enable this through the getPlatformProxy().

The local email binding previously used Miniflare's loopback server to write preview files. That deadlocks when called through the Node proxy, so this switches those file writes to a workerd disk service instead.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix

A picture of a cute animal (not mandatory, but encouraged)


Open in Devin Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: 65a1eb5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Apr 29, 2026
@workers-devprod workers-devprod requested review from a team and vicb and removed request for a team April 29, 2026 12:46
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 29, 2026

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/miniflare/src/plugins/email/index.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/workers/email/send_email.worker.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/plugins/email/index.spec.ts: [@cloudflare/wrangler]
  • packages/wrangler/e2e/dev.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/e2e/get-platform-proxy.test.ts: [@cloudflare/wrangler]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Changeset Review

File Reviewed

.changeset/email-platform-proxy.md

Review Results

✅ All changesets look good

Summary

  • Version Type: patch for miniflare - acceptable choice as this is exposing existing binding functionality that was missing from the platform proxy
  • Changelog Quality: Clear description explaining the change and user impact
  • Markdown Headers: No h1/h2/h3 headers found - passes formatting rule
  • Usage Example: Includes helpful example showing the API usage pattern

The changeset effectively communicates that send_email bindings are now accessible via getPlatformProxy() for local Node development, resolving failures when calling env.EMAIL.send().

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 29, 2026

UnknownError: ProviderInitError

github run

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 29, 2026

@edmundhung Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13723

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13723

miniflare

npm i https://pkg.pr.new/miniflare@13723

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13723

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13723

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13723

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13723

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13723

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13723

wrangler

npm i https://pkg.pr.new/wrangler@13723

commit: 65a1eb5

@edmundhung edmundhung force-pushed the fix/send-email-platform-proxy branch 2 times, most recently from 2ab37cc to 4b36bb3 Compare April 29, 2026 14:30
devin-ai-integration[bot]

This comment was marked as resolved.

@edmundhung edmundhung force-pushed the fix/send-email-platform-proxy branch from 4b36bb3 to ec39d73 Compare April 29, 2026 14:45
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

Can't use send_email binding when in local development using proxy bindings

2 participants