From 75e3e453fe13ee6aee2e10267be63ce7c571e0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Duarte?= Date: Mon, 26 Aug 2024 15:21:33 +0100 Subject: [PATCH] fix: don't use WorkerEntrypoint env or ctx in email handlers --- worker-build/src/js/shim.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worker-build/src/js/shim.js b/worker-build/src/js/shim.js index 6efdbdd5..0e62d5e3 100644 --- a/worker-build/src/js/shim.js +++ b/worker-build/src/js/shim.js @@ -21,8 +21,10 @@ class Entrypoint extends WorkerEntrypoint { return await imports.scheduled(event, this.env, this.ctx) } - async email(message) { - return await imports.email(message, this.env, this.ctx) + // For some reason, email events doesn't seem to use WorkerEntrypoint so we get the env and ctx from + // from the function itself. + async email(message, _env, _ctx) { + return await imports.email(message, _env, _ctx) } }