Skip to content

ExecutionContext can't be defined #5617

@NejcZdovc

Description

@NejcZdovc

Problem:

In the latest version type of ExecutionContext was changed from any to unknown.

Before (version 4.20250816.0):

interface ExecutionContext {
  waitUntil(promise: Promise<any>): void;
  passThroughOnException(): void;
  props: any;
}

After (version 4.20251128.0):

interface ExecutionContext<Props = unknown> {
  waitUntil(promise: Promise<any>): void;
  passThroughOnException(): void;
  readonly exports: Cloudflare.Exports;
  readonly props: Props;
}

Because of this change our Typescript compiler is complaining that property that we have in context doesn't exist on unknown.

Proposal:

I am raising a PR where I added option to pass type to ExecutionContext.

Metadata

Metadata

Labels

typesRelated to @cloudflare/workers-types

Type

No type

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions