wachunga / omega

Real-time issue tracker optimized for small teams
http://omegatracker.herokuapp.com
MIT License
114 stars 26 forks source link

Problem with socket configuration #18

Closed sadiqhabib closed 6 years ago

sadiqhabib commented 7 years ago

Hi i am trying to use this project but i am getting this error

TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (<project-path>\omega\node_modules\socket.io\lib\store.js:35:41)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (<project-path>\omega\node_modules\socket.io\lib\manager.js:14:13)
    at Module._compile (module.js:569:30)
micsun-al commented 6 years ago

+1

sadiqhabib commented 6 years ago

@micsun-al this project is using old version of socket.io. so the only solution is you have to downgrade your npm and node version, Or implement new version in this project :-)

wachunga commented 6 years ago

I would definitely accept a PR to use modern socket.io or even just plain websockets. It's on my list but I just haven't made the time.

diginfo commented 6 years ago

I have this issue too Node V7

I tried using the amended package.json file to use socket.io 2 but that crashed with another error:

Starting development server
/usr/share/nodejs/omega/server/lib/tracker.js:19
    that.io.configure(function () {
            ^

TypeError: that.io.configure is not a function
    at Object.tracker.init (/usr/share/nodejs/omega/server/lib/tracker.js:19:10)
    at Object.<anonymous> (/usr/share/nodejs/omega/server/app.js:216:9)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/share/nodejs/omega/server.js:3:1)
diginfo commented 6 years ago

Seems to be working now, by commenting out that.io.configure which no longer exists in socket.io:

/lib/tracker.js

tracker.init = function (app, projectDao, realIssueDao) {
    var that = this;
    that.io = sio.listen(app);

    /*
    that.io.configure(function () {
        // excluded websocket due to Chrome bug: https://github.com/LearnBoost/socket.io/issues/425
        that.io.set('transports', ['htmlfile', 'xhr-polling', 'jsonp-polling']);
    });
  */

    issueDao = realIssueDao;
    projectDao.findAll(function (err, projects) {
        _.each(projects, function (project) {
            that.listen(project);
        });
    });
};
wachunga commented 6 years ago

Published as 1.1.0.