You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We optionally annotate the express Request with a rawBody field.// Express leaves the Express namespace open to allow merging of new fields.declare global {// eslint-disable-next-line @typescript-eslint/no-namespacenamespaceExpress{exportinterfaceRequest{rawBody?: Buffer;}}}
I get error Property 'rawBody' does not exist on type 'Request<ParamsDictionary>' when implement handler which uses Request.rawBody attribute like below:
I think functions-framework-nodejs should change implicit interface extension to explicit and provide stand-alone Request with rawBody attribute to avoid this workaround mess in depended applications code.
The text was updated successfully, but these errors were encountered:
dobromyslov
changed the title
Implicit Request interface extension causes error property rawBody does not exists on type
Implicit Request interface extension causes error 'property rawBody does not exists on type'
Aug 14, 2020
dobromyslov
changed the title
Implicit Request interface extension causes error 'property rawBody does not exists on type'
Implicit Request interface extension causes error 'property rawBody does not exist on type'
Aug 14, 2020
Cloud functions implicitly extend express Request interface with rawBody (see https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/master/src/invoker.ts#L44):
I get error
Property 'rawBody' does not exist on type 'Request<ParamsDictionary>'
when implement handler which uses Request.rawBody attribute like below:As a workaround I have to create and use my own type instead of native Express Request:
If you have a look at the
firebase-functions
repository then you will see they use explicit extension of Request interface and then use it in code (https://github.com/firebase/firebase-functions/blob/master/src/providers/https.ts#L33)I think
functions-framework-nodejs
should change implicit interface extension to explicit and provide stand-alone Request with rawBody attribute to avoid this workaround mess in depended applications code.The text was updated successfully, but these errors were encountered: