-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with FunctionsFramework::cloudEvent() #159
Comments
I may have found the issue.
$this->function = new CloudEventFunctionWrapper($target, false); So it is not possible to call FunctionsFramework::cloudEvent() as documented, since a function parameter can't have both types (or, at least, this specific implementation can't read more than one). I'm wondering if the use of \Google\CloudFunctions\CloudEvent() is incorrect, and it should be \CloudEvents\V1\CloudEvent(). |
Having issues with FunctionsFramework::cloudEvent() when running in Cloud Functions (but not locally) as documented at https://cloud.google.com/functions/docs/tutorials/pubsub#preparing_the_application.
I'm calling the following:
This runs locally, but when I run it on Cloud Run the it tells me I have to hint Google\CloudFunctions\CloudEvent, but if I do that it wants CloudEventInterface instead. Putting either results in the other being required.
I can't repeat this locally. FunctionsFramework calls the following, which locally always forces CloudEventInterface, and I can debug this right through to the Reflection check on line 71 of CloudEventFunctionWrapper
If I do both (which seems probably unintended and wrong anyway), I get the following error:
I'm not even sure how to proceed here, as this is the officially documented approach, but doesn't appear in the readme for this project at all.
The text was updated successfully, but these errors were encountered: