Raneto icon indicating copy to clipboard operation
Raneto copied to clipboard

multiple instances fails to start

Open mariuspana opened this issue 6 years ago • 0 comments

Hello,

While trying to start multiple instances as provided via the multiple-instances.js configuration I receive the following error:

/Users/mpana/Development/help.spearhead.systems/app/index.js:30 if (config.content_dir[config.content_dir.length - 1] !== path.sep) { config.content_dir += path.sep; } ^

TypeError: Cannot read property 'length' of undefined at initialize (/Users/mpana/Development/help.spearhead.systems/app/index.js:30:45) at Object. (/Users/mpana/Development/help.spearhead.systems/kb/server.js:24:11) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:193:16) at bootstrap_node.js:617:3

I added some console.logs here and there trying to find what content_dir should be. By placing a console.log(path.sep) and console.log(content_dir) right before the offending line in server.js I noticed that during startup it iterates three times over this variable and on the third iteration it is undefined:

$ npm start

[email protected] start /Users/mpana/Development/help.spearhead.systems/kb node server.js

/ /Users/mpana/Development/help.spearhead.systems/kb/content/ / /Users/mpana/Development/help.spearhead.systems/kb/content/ / undefined /Users/mpana/Development/help.spearhead.systems/app/index.js:30 if (config.content_dir[config.content_dir.length - 1] !== path.sep) { config.content_dir += path.sep; }

Hopefully someone with a bit more node/javascript experience can help.

The reason for multiple instances is that we would like to run provide multiple languages.

Cheers, Marius

mariuspana avatar Mar 11 '18 11:03 mariuspana