[fix] change file watcher port only in dev environment (#3232)
Fixes error https://discuss.erpnext.com/t/frappe-v8-0-20-later-socketio-error/22973
This commit is contained in:
parent
8959be9b1c
commit
da1ade6a97
1 changed files with 9 additions and 4 deletions
|
|
@ -196,10 +196,15 @@ frappe.socket = {
|
|||
},
|
||||
setup_file_watchers: function() {
|
||||
var host = window.location.origin;
|
||||
var port = '6787';
|
||||
// remove the port number from string
|
||||
host = host.split(':').slice(0, -1).join(":");
|
||||
host = host + ':' + port;
|
||||
if(window.dev_server) {
|
||||
var port = '6787';
|
||||
var parts = host.split(":");
|
||||
// remove the port number from string if exists
|
||||
if (parts.length > 2) {
|
||||
host = host.split(':').slice(0, -1).join(":");
|
||||
}
|
||||
host = host + ':' + port;
|
||||
}
|
||||
|
||||
frappe.socket.file_watcher = io.connect(host);
|
||||
// css files auto reload
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue