Closed Geek-Bob closed 2 months ago
Uncaught (in promise) TypeError: Failed to fetch
at 5079-09e911dc198f986f.js:1:17587
at new Promise (
To resolve the issue where the imported flow configuration in your self-hosted Dify version 0.6.5 cannot be automatically saved, and to address the JavaScript error TypeError: Failed to fetch
with a net::ERR_EMPTY_RESPONSE
during a debugging session, you should ensure that the URL being fetched is correct and that the server is properly responding to the requests.
Here are some steps to troubleshoot and resolve the issue:
Check the URL: Ensure that the chatbotUrl
being saved and fetched is correct and accessible. You can do this by manually visiting the URL in your browser to see if it responds correctly.
Server Response: Ensure that the server is running and properly configured to handle the requests. Check the server logs for any errors or issues that might be causing it to not respond.
Network Issues: Ensure there are no network issues preventing the request from reaching the server. This can include firewall settings, network configurations, or other network-related issues.
Browser Console: Check the browser console for more detailed error messages that might give more insight into why the request is failing.
Here is the relevant part of the code that handles saving the chatbotUrl
:
document.getElementById('save-button').addEventListener('click', function (e) {
e.preventDefault();
const chatbotUrl = document.getElementById('chatbot-url').value;
const errorTip = document.getElementById('error-tip');
if (chatbotUrl.trim() === "") {
errorTip.textContent = "Dify ChatBot URL cannot be empty.";
} else {
errorTip.textContent = "";
chrome.storage.sync.set({
'chatbotUrl': chatbotUrl,
}, function () {
alert('Save Success!');
});
}
});
And the part that loads the chatbotUrl
:
chrome.storage.sync.get(['chatbotUrl'], function (result) {
const chatbotUrlInput = document.getElementById('chatbot-url');
if (result.chatbotUrl) {
chatbotUrlInput.value = result.chatbotUrl;
}
});
Ensure that the chatbotUrl
is correctly set and retrieved from chrome.storage.sync
. If the issue persists, further investigation into the server-side code and network configurations will be necessary [[1]](https://github.com/langgenius/dify/blob/main/third-party/chrome plug-in/options.js).
To continue talking to Dosu, mention @dosu.
It's not the URL, because when you delete all the nodes, it's automatically saved
Imported **.yml file code nodes with the following two lines will not refresh automatically.
function main({arg1, empNoStr}) {
var newStr= arg1.replace(/```json\\n|```/g, '');
var timestamp=Date.now().toString();
}
Self Checks
Dify version
0.6.5
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
The imported flow configuration cannot be automatically saved Current BUG module:chat flow
As you belong, there is no auto-save prompt, only post prompt
✔️ Expected Behavior
automatically saved
❌ Actual Behavior
The imported flow configuration cannot be automatically saved