Skip to content

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

Closed

Description

@qiulang

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")

Activity

  1. changed the title [-]I only have dashboard and servers menu[/-] [+]"Error: Could not encode" when set mode "development"[/+] on Jul 19, 2022
  2. qiulang commented on Jul 19, 2022

    @qiulang
    Author

    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.

  3. mgarf commented on Aug 19, 2022

    @mgarf

    +1 seeing it myself as well

  4. mgarf commented on Aug 19, 2022

    @mgarf

    Here is my stacktrace (similar to above)

    image

  5. aryaman-titan commented on Oct 5, 2022

    @aryaman-titan

    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 ?

  6. darrachequesne commented on Oct 6, 2022

    @darrachequesne
    Member

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

    I'll publish a new version later today.

  7. aryaman-titan commented on Oct 6, 2022

    @aryaman-titan

    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

  8. darrachequesne commented on Oct 7, 2022

    @darrachequesne
    Member

    Released in 0.5.1. Thanks for your patience 👍

  9. added
    bug
    on Oct 7, 2022
  10. added this to the 0.5.1 milestone on Oct 7, 2022
  11. qiulang commented on Oct 10, 2022

    @qiulang
    Author

    @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.

  12. qiulang commented on Oct 10, 2022

    @qiulang
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions