Client scripts functionality not working!

default FRAPPE_DOCKER installation does not have client script functionality working
due to websocket.io not connecting. I have tried on 3 different pc’s all windows 10 and windows 11.
all three have the same result. what can be done or needs fixing for this to work on my side?

@jacobotha777 I don’t think socketio will cause the client script to stop functioning . however you can check the port and expose it if it’s closed by docker container .
also share any errors you are facing so we can assist further .

this error shows when inspecting in browser console

hi @bahaou . below is just a copy and paste of the logfile created in docker websocket container.
not sure if this info can help to clarify?

2024-12-09 11:00:49 node:internal/process/promises:288
2024-12-09 11:00:49 triggerUncaughtException(err, true /* fromPromise */);
2024-12-09 11:00:49 ^
2024-12-09 11:00:49
2024-12-09 11:00:49 Error: connect ECONNREFUSED 127.0.0.1:6379
2024-12-09 11:00:49 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
2024-12-09 11:00:49 Emitted ‘error’ event on RedisClient instance at:
2024-12-09 11:00:49 at RedisSocket. (/home/frappe/frappe-bench/apps/frappe/node_modules/@redis/client/dist/lib/client/index.js:412:14)
2024-12-09 11:00:49 at RedisSocket.emit (node:events:517:28)
2024-12-09 11:00:49 at RedisSocket._RedisSocket_connect (/home/frappe/frappe-bench/apps/frappe/node_modules/@redis/client/dist/lib/client/socket.js:166:18)
2024-12-09 11:00:49 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-12-09 11:00:49 at async RedisClient.connect (/home/frappe/frappe-bench/apps/frappe/node_modules/@redis/client/dist/lib/client/index.js:185:9)
2024-12-09 11:00:49 at async /home/frappe/frappe-bench/apps/frappe/realtime/index.js:47:2 {
2024-12-09 11:00:49 errno: -111,
2024-12-09 11:00:49 code: ‘ECONNREFUSED’,
2024-12-09 11:00:49 syscall: ‘connect’,
2024-12-09 11:00:49 address: ‘127.0.0.1’,
2024-12-09 11:00:49 port: 6379
2024-12-09 11:00:49 }
2024-12-09 11:00:49
2024-12-09 11:00:49 Node.js v18.18.2
2024-12-09 11:00:49 Realtime service listening on: 9000
2024-12-09 11:01:04 Realtime service listening on: 9000
2024-12-10 07:46:24 Realtime service listening on: 9000
2024-12-10 09:51:57 Realtime service listening on: 9000

@jacobotha777 do a docker ps to see your container’s ports .

ok you using multi containers . try to expose port 9000 for the erpnext workers .
I still think this is not the issuer of your client server not running . socketio is not mandatory to run your erpnext app .

I will doublecheck if port 9000 is exposed. I think it is already.
what else can be the issue for scripts not working? I am at a loss currently.

@jacobotha777 please explain how they are not working ? are you writing client scripts but simply not running ?

when testing a basic client script like the button example it does not add the button when refreshing the browser page. i just use the quotation form as example location

frappe.ui.form.on(‘Quotation’, {
refresh: function(frm) {
frm.add_custom_button(__(‘Get User Email Address’), function() {
frappe.msgprint(frm.doc.email);
}, __(“Utilities”));
}
});

can you maybe explain an alternate method to quickly test if client scripts work?

@jacobotha777 share a screenshot of where you written the code


script code screenshot to follow

any other suggestions? did my script seem fine?
still struggling with client scripts not functioning

@jacobotha777 can you share screen from quotation and screenshot of console

after refreshing this is result

Update utils.js to make websockets functional · Nirmaan-app/frappe@b1af4e7 · GitHub

I found this post on github forum, but I am simply not educated enough to know how I implement this fix!

it seems that the default repository has an issue and must be fixed?

@jacobotha777 please create one quotation and open it . the client script type form function only inside the doctype page .

I now know where I slipped up. I apologise!!! thank you for clearing this up for me.
your patients and help is much appreciated :pray: :pray: