Skip to content

Commit

Permalink
fix: don't use WorkerEntrypoint env or ctx in email handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisDuarte1 committed Aug 26, 2024
1 parent c245ea8 commit 75e3e45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worker-build/src/js/shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 75e3e45

Please sign in to comment.