TypeError: Cannot read property 'source' of undefined
at V2Agent.processRequest_ (/user_code/node_modules/dialogflow-fulfillment/src/v2-agent.js:108:86)
at new WebhookClient (/user_code/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:193:17)
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/user_code/index.js:38:17)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/providers/https.js:26:47)
at /var/tmp/worker/worker.js:676:7
at /var/tmp/worker/worker.js:660:9
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Hi! Thanks for trying out the library, sorry you had issues with one of the samples. I've replicated and fixed the issue which is now published here on Github. Please try it now and open another issue if it still doesn't work.
@matthewayne Would you mind elaborating on the cause and the fix please? I am getting exact same error for my own example. Thanks.
@matthewayne: We're getting the same issue - proposed fix in #51 - please review...
i am using an API to fetch stock info but i am getting this error
TypeError: Cannot read property 'action' of undefined
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/user_code/index.js:12:39)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/providers/https.js:26:47)
at /var/tmp/worker/worker.js:684:7
at /var/tmp/worker/worker.js:668:9
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
It is very hard to debug cloud functions. What am i doing wrong?
Here is the fulfillment request:
{
"responseId": "db3bed0d-85d6-4f23-be7a-f3de120ed42b",
"queryResult": {
"queryText": "yesterday",
"action": "input.getStockPrice",
"parameters": {
"price_type": "closing",
"company_name": "nordstrom",
"date": "2018-07-14T12:00:00-07:00"
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/stockmarkettracker-a3ac2/agent/intents/ba9121d5-7fec-4ece-bc98-ffd33ed1bbf3",
"displayName": "GetStockPrice"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {
"webhook_latency_ms": 1763
},
"languageCode": "en"
},
"webhookStatus": {
"code": 13,
"message": "Webhook call failed. Error: 500 Internal Server Error"
}
}
Most helpful comment
@matthewayne Would you mind elaborating on the cause and the fix please? I am getting exact same error for my own example. Thanks.