Skip to content

BaselimeLoggerArgs ctx type error for Cloudflare Page Functions context #17

Description

@t510599

For the following code:

export const onRequestGet: PagesFunction<Env> = async (context) => {
    const url = new URL(context.request.url);

    const logger = new BaselimeLogger({
        service: '<name>',
        namespace: `${context.request.method} ${url.hostname}${url.pathname}`,
        apiKey: context.env.BASELIME_API_KEY,
        ctx: context,
        isLocalDev: context.env.IS_LOCAL
    });
}

It would complain errors on the type of context does not has property props.
Error: TS2741: Property 'props' is missing in type 'EventContext<Env, any, Record<string, unknown>>' but required in type 'ExecutionContext'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions