socketio / socket.io-admin-ui

Admin UI for Socket.IO

Home Page:https://admin.socket.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Error: Could not encode" when set mode "development"

qiulang opened this issue · comments

I notice I only have dashboard and servers menu
after login

I think this is because start my nodejs using "NODE_ENV=production node index.js" so I set mode code specifically in code

instrument(io, {
  auth: {
     ...
  },
  mode: "development"
});

But then server crash with error

Error: Could not encode
 at _encode (/home/express/node_modules/notepack.io/lib/encode.js:256:13)
 at _encode (/home/express/node_modules/notepack.io/lib/encode.js:162:19)
 at _encode (/home/express/node_modules/notepack.io/lib/encode.js:162:19)
 at _encode (/home/express/node_modules/notepack.io/lib/encode.js:246:17)
 at _encode (/home/express/node_modules/notepack.io/lib/encode.js:162:19)
 at Object.encode (/home/express/node_modules/notepack.io/lib/encode.js:261:41)
 at RedisAdapter.broadcast (/home/express/node_modules/socket.io-redis/dist/index.js:313:33)
 at BroadcastOperator.emit (/home/express/node_modules/socket.io/dist/broadcast-operator.js:109:22)
 at Namespace.emit (/home/express/node_modules/socket.io/dist/namespace.js:170:73)
 at Socket.<anonymous> (/home/express/node_modules/@socket.io/admin-ui/dist/index.js:284:36)

I searched this error and found someone else also hit this error

https://bestofvue.com/repo/socketio-socket-io-admin-ui-vuejs-web-sockets (at "7. Error serialising sockets with session stores")

I saw this issue #7 was closed at 0.1.2 but I am using 0.4.0 (and "socket.io-redis": "^6.1.1") and still hit it.

+1 seeing it myself as well

Here is my stacktrace (similar to above)

image

I'm encountering the same issue, only with mode set as "development", otherwise it works great.
Is there any workaround available for the same @qiulang @darrachequesne ?

I think I have found the culprit, this should be fixed by 6d58a75.

I'll publish a new version later today.

I think I have found the culprit, this should be fixed by 6d58a75.

I'll publish a new version later today.

That's awesome! Waiting for it

Released in 0.5.1. Thanks for your patience 👍

@darrachequesne I have verified 0.5.1 worked and I would like turn it into feature request: is it possible to make mode setting a runtime setting, so I can turn it on and off when I need ?

I understand the development mode will be a burden to https://admin.socket.io/ but we will host the Admin UI server ourselves so a runtime setting is more appropriate.

@darrachequesne 0.5.1 also fixed the issue I raised here darrachequesne/notepack#29