I have worked out that the cause of the error is when you change the httpRoot in the config or node-red as per below.
I need to change the http root to be able to reverse proxy with lets encrypt
// The following property can be used in place of ‘httpAdminRoot’ and ‘httpNodeRoot’,
// to apply the same root to both parts.
httpRoot: ‘/node-red’,
On line 47 of server-events-state-changed.html - we can see the url it fetches to show entities, as it does not take into account httpRoot variable I have done a quick and dirty hard code - I am sure there must be a better way of fixing this but I am not a coder as you can see below all I have done is manually put in the additional info for my installation.
For reference, I have fixed this issue on my WebSocket fork if people need to use httpRoot or httpAdminRoot in their setup and want it working out of the box.