8000 Clarification on using CloudEventsContext / Context type · Issue #425 · GoogleCloudPlatform/functions-framework-nodejs · GitHub
[go: up one dir, main page]

Skip to content
Clarification on using CloudEventsContext / Context type #425
Closed
@jketcham

Description

@jketcham

I have a cloud function (triggered by PubSub) I've written in Typescript and transpiled with babel which was using the CloudEventsContext type exported in version 1.9.0. When I tried to upgrade to version 2.1.1, I now get the following errors:

node_modules/cloudevents/dist/index.d.ts(7,60): error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.
src/index.ts(1,15): error TS2305: Module '"@google-cloud/functions-framework"' has no exported member 'CloudEventsContext'.

It looks like I should now be using the Context type, but them I'm running into the same Cannot access ambient const enums error with the --isolatedModules flag, which looks like it's related to this issue with cloudevents itself: cloudevents/sdk-javascript#456.

Can anyone provide any guidance on how I should type my cloud functions with CloudEvent context going forward? Is this something that needs to be addressed in the cloudevents repo?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0