Karma Run Failure due to script load/require failure in intellijServer.js

I can run it from the command line, but I must have something configured incorrectly in the ide.

OS X 10.10.4
WebStorm 10.0.4


/usr/local/bin/node /Applications/WebStorm.app/Contents/plugins/js-karma/js_reporter/karma-intellij/lib/intellijServer.js --karmaPackageDir=/Users/rbirch/Development/projects/sandbox/trees/jstree/node_modules/karma --configFile=/Users/rbirch/Development/projects/sandbox/trees/jstree/karma.conf.js

/Applications/WebStorm.app/Contents/plugins/js-karma/js_reporter/karma-intellij/lib/intellijServer.js:10
server.start(cliOptions);
       ^
TypeError: undefined is not a function
  at Object.<anonymous> (/Applications/WebStorm.app/Contents/plugins/js-karma/js_reporter/karma-intellij/lib/intellijServer.js:10:8)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Function.Module.runMain (module.js:501:10)
  at startup (node.js:129:16)
  at node.js:814:3


Debug Configurations 2015-07-16 17-19-05.jpg
0
3 comments
Avatar
Permanently deleted user

Looking through the code and dumping some infor out -
/Applications/WebStorm.app/Contents/plugins/js-karma/js_reporter/karma-intellij/lib/intellijCli.js

 
var cli = require('./intellijCli.js')
  , server = cli.requireKarmaModule('lib/server.js')
  , cliOptions = { configFile: require.resolve('./intellij.conf.js') };

var
browsers = cli.getBrowsers();
if
(browsers != null) {
  cliOptions.browsers = browsers;
}
server.start(cliOptions);  // The start is suppose to be attached to via proto-type in karma/lib/server.js
                           // I can directly invoke it via server.prototype.start(cliOptions), 
                           // but then the this in the function appears to be wrong?? 

// Prevent karma server from being an orphan process.
// For example, if WebStorm is killed using SIGKILL, karma server will still be alive.
// When WebStorm is terminated, karma server's standard input is closed automatically.
process.stdin.resume();
process.stdin.on('close', function () {
  // terminating orphan process
  
process.exit(123);
});
0
Avatar
Permanently deleted user

Thanks for the response!

Yes, I have the same issue for the same reason "Improved Public API": https://github.com/karma-runner/karma/commit/82cbbaddd599ac248f03fda124aa0e6466e7d09f

Yes, the workaround worked!

I am using: Karma version: 0.13.0

0

Please sign in to leave a comment.