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
The standard dify-web docker container allows to embed the Chatbot in an Iframe on a website.
As I needed to customize the frontend, I followed the instructions and deployed the webapp-conversations frontend on vercel.
It runs perfectly when I open the Vercel URL directly. As soon as I embed it into an Iframe, I always get the error, that the chatbot is still responding, when I try to send a second message.
Already tested:
Using a Reverseproxy in front of Vercel
Using Browser Dev Tools to find possible CORS Errors ect.
Using other Browsers: Chrome, Safari -> Not working, Firefox-> Working
The text was updated successfully, but these errors were encountered:
I was able to fix it on my own. The problem was: /app/compontents/index.tsx: The "oncompleted" function fails while fetching the conversations.id . Therefore the bot never reaches the state, where the "setResponsingFalse()" is set.
I rewrote the async onCompleted like this:
async onCompleted(hasError?: boolean) {
// Immediately set the chatbot as not responding, regardless of potential errors in fetching conversations
setResponsingFalse();
if (hasError) {
return; // Early return if there was an error in the chat message operation
}
try {
// Attempt to fetch all conversations and generate a new name for the conversation
const { data: allConversations }: any = await fetchConversations();
if (allConversations && allConversations.length > 0) {
const newItem: any = await generationConversationName(allConversations[0].id);
// Proceed with setting new conversation information and resetting state as needed
const newAllConversations = produce(allConversations, (draft: any) => {
draft[0].name = newItem.name;
});
setConversationList(newAllConversations as any);
// Additional logic to reset inputs and conversation IDs as needed
if (getConversationIdChangeBecauseOfNew()) {
setConversationIdChangeBecauseOfNew(false);
resetNewConversationInputs();
setChatNotStarted();
setCurrConversationId(allConversations[0].id, APP_ID, true);
}
} else {
// Handle the case where no conversations are returned
console.error("No conversations were fetched.");
}
} catch (error) {
console.error("An error occurred while fetching conversations or generating a new conversation name:", error);
// Here, handle the error as needed, possibly setting additional error states or displaying a message to the user
}
},
The standard dify-web docker container allows to embed the Chatbot in an Iframe on a website.
As I needed to customize the frontend, I followed the instructions and deployed the webapp-conversations frontend on vercel.
It runs perfectly when I open the Vercel URL directly. As soon as I embed it into an Iframe, I always get the error, that the chatbot is still responding, when I try to send a second message.
Already tested:
The text was updated successfully, but these errors were encountered: