{"action":"opened","issue":{"url":"https://api.github.com/repos/karma-runner/grunt-karma/issues/174","labels_url":"https://api.github.com/repos/karma-runner/grunt-karma/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/karma-runner/grunt-karma/issues/174/comments","events_url":"https://api.github.com/repos/karma-runner/grunt-karma/issues/174/events","html_url":"https://github.com/karma-runner/grunt-karma/issues/174","id":123259674,"number":174,"title":"Running with \"background\" set to true raises error \"Cannot read property 'write' of null\"","user":{"login":"iandarlingmnetics","id":8122718,"avatar_url":"https://avatars.githubusercontent.com/u/8122718?v=3","gravatar_id":"","url":"https://api.github.com/users/iandarlingmnetics","html_url":"https://github.com/iandarlingmnetics","followers_url":"https://api.github.com/users/iandarlingmnetics/followers","following_url":"https://api.github.com/users/iandarlingmnetics/following{/other_user}","gists_url":"https://api.github.com/users/iandarlingmnetics/gists{/gist_id}","starred_url":"https://api.github.com/users/iandarlingmnetics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iandarlingmnetics/subscriptions","organizations_url":"https://api.github.com/users/iandarlingmnetics/orgs","repos_url":"https://api.github.com/users/iandarlingmnetics/repos","events_url":"https://api.github.com/users/iandarlingmnetics/events{/privacy}","received_events_url":"https://api.github.com/users/iandarlingmnetics/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T11:25:06Z","updated_at":"2015-12-21T11:25:06Z","closed_at":null,"body":"Environment: Windows 7 x64, Node.js 4.2.3, grunt-karma 0.12.1, karma 0.13.15.\r\n\r\nRecently upgraded from Node.js 0.12.x, grunt-karma ^0.10.1, karma ^0.12.31\r\n\r\nWe have two different grunt tasks - the first that runs karma in a single-run/foreground setup that is used for CI, etc, and the second in a more \"watch/live-reload\" style setup.\r\n\r\nThe two tasks have almost identical setups, with the only difference being around the singleRun and background settings, and it is changing the background setting that raises the issue.  When background is set to true, the task fails with the following errors:\r\n\r\n````\r\nTypeError: Cannot read property 'write' of null\r\n    at Object.<anonymous> (C:\\project\\node_modules\\grunt-karma\\tasks\\grunt-karma.js:118:30)\r\n    at Object.<anonymous> (C:\\project\\node_modules\\grunt\\lib\\grunt\\task.js:264:15)\r\n    at Object.thisTask.fn (C:\\project\\node_modules\\grunt\\lib\\grunt\\task.js:82:16)\r\n    at Object.<anonymous> (C:\\project\\node_modules\\grunt\\lib\\util\\task.js:301:30)\r\n    at Task.runTaskFn (C:\\project\\node_modules\\grunt\\lib\\util\\task.js:251:24)\r\n    at Task.<anonymous> (C:\\project\\node_modules\\grunt\\lib\\util\\task.js:300:12)\r\n    at C:\\project\\node_modules\\grunt\\lib\\util\\task.js:227:11\r\n    at doNTCallback0 (node.js:419:9)\r\n    at process._tickCallback (node.js:348:13)\r\n```\r\n\r\nThis appears to be an issue with passing the parameters across stdin to the background process.\r\n\r\nA second after the above error there is a second error logged to the console, which seems to be the failure on the other side of this:\r\n\r\n```\r\nTypeError: Cannot read property 'logLevel' of null\r\n    at new Server (C:\\project\\node_modules\\karma\\lib\\server.js:52:25)\r\n    at ReadStream.<anonymous> (C:\\project\\node_modules\\grunt-karma\\lib\\background.js:4:16)\r\n    at emitNone (events.js:67:13)\r\n    at ReadStream.emit (events.js:166:7)\r\n    at emitReadable_ (_stream_readable.js:411:10)\r\n    at emitReadable (_stream_readable.js:405:7)\r\n    at ReadStream.Readable.read (_stream_readable.js:268:7)\r\n    at ReadStream.Socket.read (net.js:283:43)\r\n    at nReadingNextTick (_stream_readable.js:693:8)\r\n    at doNTCallback1 (node.js:430:9)\r\n    at process._tickCallback (node.js:352:17)\r\n    at Function.Module.runMain (module.js:469:11)\r\n    at startup (node.js:136:18)\r\n    at node.js:963:3\r\n```"}}