codegl / tracegl

traceGL support repository
84 stars 5 forks source link

Server dies when checking for updates in Xubuntu #89

Open xarvh opened 11 years ago

xarvh commented 11 years ago
nw@salad ~/direct-web/advertiser master$ node tracegl.js server.js 
[trace.GL] See your code. This product has a commercial license.
[trace.GL] WebGL trace UI: http://0.0.0.0:2000
[trace.GL] Checking for update...
/home/nw/direct-web/advertiser/tracegl.js:4105
n = define.factory[k].toString().match(/\/\/CHANNEL\n([\s\S]*)\/\/CHANNEL/)[1]
                                                                           ^
TypeError: Cannot read property '1' of null
    at mkHead (/home/nw/direct-web/advertiser/tracegl.js:4105:84)
    at instrument (/home/nw/direct-web/advertiser/tracegl.js:4111:20)
    at Module.m._compile (/home/nw/direct-web/advertiser/tracegl.js:36:12)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at Function.require (module.js:378:17)
    at nodeLoader (/home/nw/direct-web/advertiser/tracegl.js:48:10)
    at Object./trace/trace_server (/home/nw/direct-web/advertiser/tracegl.js:23:65)
up to date.

Using node v0.8.24 on Xubuntu Precise, works correctly on Mac with the same node version. It seems like define.factory is an empty object.

avetisk commented 10 years ago

You can fix that by changing that line from this: var chn = define.factory[k].toString().match(/\/\/CHANNEL\n([\s\S]*)\/\/CHANNEL/)[1] to var chn = define.factory[k].toString().match(/\/\/CHANNEL(?:\n|\r)([\s\S]*)\/\/CHANNEL/)[1].trim();