I had working code as below on functions-framework@1.4.0:
import { CloudFunctionsContext } from '@google-cloud/functions-framework';
import { Message } from '@google-cloud/pubsub';
/**
* A cloud function triggered by a PubSub message.
* @see https://cloud.google.com/functions/docs/writing/background#function_parameters
*/
exports.pubsub = async function pubsub(
pubsubMessage: Message,
context: CloudFunctionsContext
) {
...
after updating to latest (1.7.1), I got TS error on first line:
Module '"../node_modules/@google-cloud/functions-framework/build/src/invoker"' has no exported member 'CloudFunctionsContext'.ts(2305)
I resolved this by changing the line to
import { CloudFunctionsContext } from '@google-cloud/functions-framework/build/src/functions';
but it suggests a couple questions:
- Was I (and am I know) using the types as intended, and
- Was this an intentional change (I did see some refactors mentioned in the release log), or should
CloudFunctionsContext still be exported from the top level?
Thanks!
I had working code as below on functions-framework@1.4.0:
after updating to latest (1.7.1), I got TS error on first line:
I resolved this by changing the line to
but it suggests a couple questions:
CloudFunctionsContextstill be exported from the top level?Thanks!