Skip to content

2.0.2 come across breakchange  #2963

@ngot

Description

@ngot

Note: for support questions, please use one of these channels: stackoverflow or slack

You want to:

  • report a bug

Current behaviour

/root/projects/agent-server/node_modules/_egg@1.3.0@egg/lib/application.js:38
      throw e;
      ^

TypeError: Cannot convert undefined or null to object
    at Namespace.use (/root/projects/agent-server/node_modules/_socket.io@2.0.2@socket.io/lib/namespace.js:103:21)
    at initNsp (/root/projects/agent-server/node_modules/_egg-socket.io@2.0.0@egg-socket.io/lib/io.js:80:9)
    at module.exports.app (/root/projects/agent-server/node_modules/_egg-socket.io@2.0.0@egg-socket.io/lib/io.js:55:5)
    at AppWorkerLoader.loadFile (/root/projects/agent-server/node_modules/_egg-core@3.7.0@egg-core/lib/loader/egg_loader.js:270:34)
    at getLoadUnits.forEach.unit (/root/projects/agent-server/node_modules/_egg-core@3.7.0@egg-core/lib/loader/mixin/custom.js:25:29)
    at Array.forEach (native)
    at AppWorkerLoader.loadCustomApp (/root/projects/agent-server/node_modules/_egg-core@3.7.0@egg-core/lib/loader/mixin/custom.js:25:8)
    at AppWorkerLoader.load (/root/projects/agent-server/node_modules/_egg@1.3.0@egg/lib/loader/app_worker_loader.js:33:10)
    at new Application (/root/projects/agent-server/node_modules/_egg@1.3.0@egg/lib/application.js:34:19)
    at Object.<anonymous> (/root/projects/agent-server/node_modules/_egg-cluster@1.6.2@egg-cluster/lib/app_worker.js:12:13)

Steps to reproduce (if the current behaviour is a bug)

https://github.com/eggjs/egg-socket.io/tree/master/example run this demo

Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.

Expected behaviour

no error shows

Setup

  • OS: osx
  • browser:
  • socket.io version: 2.0.2

Other information (e.g. stacktraces, related issues, suggestions how to fix)

I have check this commit :
2b21690

if I delete this code .It will run ok.

delete this.server.eio.initialPacket;

It can't work with this commit, because: this.server.eio is undefined!

So, what should i do with this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions