Forum Discussion
[Bot Builder 4.0 SDK] Teams Task module not showing up HTML page
I am trying to load an HTML page using the task module, as suggested under
https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/what-are-task-modules#task-module-samples
When the user clicks an action button, the task module opens up but HTML is not getting loaded inside it.
"actions": [
{
"type": "Action.Submit",
"title": "dasdas",
"data": {
"msteams": {
"type": "task/fetch"
},
"data": "dasdas"
}
}
]
Getting error as "Unable to reach app. Please try again."
Using the below code I am trying to set the HTML page.
const htmlPageUrl = 'https://637c-27-7-******.ngrok-free.app/error.html';
await context.sendActivity({
value: {
status: 200,
body: {
task: {
type: 'continue',
value: {
title: 'My Page',
height: 400,
width: 600,
url: htmlPageUrl,
},
}
},
},
type: 'invokeResponse'
});
If I use the below code snippet, then the error "Unable to reach app. Please try again." is not seen but the popup is empty.
await context.sendActivity({
value: {
status: 200,
body: ''
},
type: 'invokeResponse'
});
Please share any pointers to get it working.
Thank you.
The issue is resolved, the issue was happening as we were using HTTP module. (const http = require('http')
Which did have methods like res.status and res.send, so the response was not being sent from function processActivityunder under botFrameworkAdapter.ts.
After we used express issue was resolved.
- adminuser01auto-ubyonCopper Contributor
The issue is resolved, the issue was happening as we were using HTTP module. (const http = require('http')
Which did have methods like res.status and res.send, so the response was not being sent from function processActivityunder under botFrameworkAdapter.ts.
After we used express issue was resolved.