Closed
Description
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
Labels
No labels