IBM Watson Assistant - Webhook Uncaught Error when saving URL - webhooks

Problem:
Webhook URLs are not saved, which breakes the entire webhook functionality.
Reproduction:
When creating a new dialog skill in the classic experience, the following error is printed to console once I've entered a webhook URL in the respective options field.
DialogSkillOptions.jsx:210 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
at DialogSkillOptions.jsx:210:42
at s (bluemix-analytics.min.js:44:30656)
at Generator._invoke (bluemix-analytics.min.js:44:30409)
at Generator.next (bluemix-analytics.min.js:44:31019)
at C (app.46eb13fc2099d97e0fdd.js:1:3312231)
at i (app.46eb13fc2099d97e0fdd.js:1:3312434)
If one then tries again to change the URL, no error is thrown. However, the URL is still not saved correctly (trying to use it in a dialog node displays the "webhook URL missing" warning box).
For the URL I used different examples, including the one from documentation.

Related

Can't open modal using `trigger_id` from Slash Command in Slack Bot

My goal is to trigger modal open using Slack slash command.
I got the trigger_id from the slash command in my slack app, and trying to open modal using it, but getting following error though I can see valid trigger_id in my console logs.
Error in trigger handler Error: An API error occurred: invalid_trigger_id
This is because of my bad.
I used push method instead of open method to open modal.
It is working after changing my code like this:
await bot.api.views.open({
trigger_id: triggerId //You can get from slash command payload,
view: view // this is the modal content view
})

Express.js : json data is not returned completely

I am developing an API for a chart that contains large JSON data, and sometimes JSON is not returned completely.
If I reload the API again after some reload, data is returned completely.
In the chrome network tab, I usually got
failed to load response data: no data found for a resource with the given identifier.
In the firefox network tab, I got the error as:

TypeError: Cannot read properties of undefined(reading 'getPosts')

I am a beginner, and i'm currently following this tutorial by freecodecamp. And I got two errors, one for the homepage:
TypeError: Cannot read properties of undefined (reading 'getPosts')
and the other one at login and register page:
Unhandled Rejection (TypeError): Cannot read properties of undefined(reading 'extensions')
Here are the screenshots of the errors,
Home page
Login/Register page
So I cloned the github repo and tried to run it, and I got the same error.
Here is the link to the github repo: https://github.com/hidjou/classsed-graphql-mern-apollo/tree/master

Opencart facebook extension unexpected token

I am on version : 2.0.1.1 and when i upload the facebook extension on my opencart admin i get the following error:
"
SyntaxError: Unexpected token < in JSON at position 0
"
I hope thats sufficient information
This generally happens when a controller returns html to the view via an AJAX call and the call is expecting JSON. In my experience the unexpected token & html that is returned tends to be a server error of some sort.
To test this out, you should disable the extension, inspect element on the page and record the network traffic. Then when you enable the extension, look at the requests that are made:
Chances are, there'll be a 500 under the "Status" column, if you click the row that has the 500 on it, you'll see details of what was sent to the controller and what was returned:
You can now look at what the unexpected token actually is by clicking "Response", chances are, it's expecting a JSON response and it's getting something else altogether:
While this won't solve your issue, it will help you troubleshoot a little more effectively.

WebhookClient doesn't work when i call api

I'm working on an app for Google Home with DialogFlowV2 but I've got a problem.
I'm using Google Cloud Functions, I've defined 3 functions, welcome, fallback and getTVShow.
The third one is the interesting one, i'm getting data from an API and send it with the add method of webhookClient.
I got this error when I call it :
Error: No responses defined for undefined
at V2Agent.sendResponse_ (/user_code/node_modules/dialogflow-fulfillment/v2-agent.js:140:13)
at WebhookClient.send_ (/user_code/node_modules/dialogflow-fulfillment/dialogflow-fulfillment.js:225:19)
at promise.then (/user_code/node_modules/dialogflow-fulfillment/dialogflow-fulfillment.js:285:38)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
I've looked into the source code and this is corresponding to the request source which is undefined after getting the data from the source in originalDetectIntentRequest from the request body.
So, i've done a console.log on the request.body.originalDetectIntentRequest and the result is :
{ payload: {} }
Therefore, it's normal to have an error but i don't want it.
Can someone help me, please ?
UPDATE
I’ve find out it only happens when i use the “playground” from DialogFlow. It's the "Try it now" input at https://console.dialogflow.com/ right side.
I've post an issue about this on the GitHub repo.
UPDATE 2
It was all about a forgotten return. When using async requests, we need to return the promise.

Resources