{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/7296","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/7296/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/7296/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/7296/events","html_url":"https://github.com/nodejs/node/issues/7296","id":160170147,"number":7296,"title":"process._tickCallback error. Undefined is not a function ","user":{"login":"sneurgaonkar","id":8036390,"avatar_url":"https://avatars.githubusercontent.com/u/8036390?v=3","gravatar_id":"","url":"https://api.github.com/users/sneurgaonkar","html_url":"https://github.com/sneurgaonkar","followers_url":"https://api.github.com/users/sneurgaonkar/followers","following_url":"https://api.github.com/users/sneurgaonkar/following{/other_user}","gists_url":"https://api.github.com/users/sneurgaonkar/gists{/gist_id}","starred_url":"https://api.github.com/users/sneurgaonkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sneurgaonkar/subscriptions","organizations_url":"https://api.github.com/users/sneurgaonkar/orgs","repos_url":"https://api.github.com/users/sneurgaonkar/repos","events_url":"https://api.github.com/users/sneurgaonkar/events{/privacy}","received_events_url":"https://api.github.com/users/sneurgaonkar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-14T12:35:07Z","updated_at":"2016-06-14T12:49:32Z","closed_at":null,"body":"Node Version: 0.10.25\r\nPlatform: Ubuntu 14 \r\n\r\nI am new to Node.js and i am developing a simple chat app using Socket.IO. I made an **index.js** file and an **index.html** file.\r\n\r\nMy **index.js** files looks like this \r\n\r\n```\r\nvar app = require('express')();\r\nvar http = require('http').Server(app);\r\nvar io = require('socket.io')(http);\r\nprocess.stdin.setEncoding('utf8');\r\nvar util = require('util');\r\nprocess.stdin.setRawMode( true );\r\nprocess.stdin.resume();\r\n\r\napp.get('/', function(req, res){\r\n  res.sendFile(__dirname + '/index.html');\r\n});\r\n\r\n// io.use(function(socket, next){\r\n//   if (socket.request.headers.cookie) return next();\r\n//   next(new Error('Authentication error'));\r\n// });\r\n\r\n var txt = process.stdin.on('data', function (text) {\r\n      process.nextTick()\r\n     return util.inspect(text);\r\n     });\r\nio.on('connection', function(socket){\r\n      socket.on('chat message', function(msg){\r\n         console.log('message: ' + msg);\r\n      process.stdin.on('data',function(key){\r\n        if(key === '\\u0003')\r\n        {\r\n          socket.emit('chat message',txt);\r\n        }\r\n        // process.stdout.write(key);\r\n      });\r\n       });\r\n    });\r\n\r\nhttp.listen(3000, function(){\r\n  console.log('listening on *:3000');\r\n});\r\n\r\n```\r\nhere is my **index.html** file\r\n\r\n```\r\n<!doctype html>\r\n<html>\r\n  <head>\r\n    <title>Socket.IO chat</title>\r\n    <style>\r\n      * { margin: 0; padding: 0; box-sizing: border-box; }\r\n      body { font: 13px Helvetica, Arial; }\r\n      form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }\r\n      form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }\r\n      form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }\r\n      #messages { list-style-type: none; margin: 0; padding: 0; }\r\n      #messages li { padding: 5px 10px; }\r\n      #messages li:nth-child(odd) { background: #eee; }\r\n    </style>\r\n  </head>\r\n  <body>\r\n    <ul id=\"messages\"></ul>\r\n    <form action=\"\">\r\n      <input id=\"m\" autocomplete=\"off\" /><button>Send</button>\r\n    </form>\r\n    <script src=\"https://cdn.socket.io/socket.io-1.2.0.js\"></script>\r\n    <script src=\"http://code.jquery.com/jquery-1.11.1.js\"></script>\r\n    <script>\r\n      var socket = io();\r\n      $('form').submit(function(){\r\n        socket.emit('chat message', $('#m').val());\r\n        $('#m').val('');\r\n        return false;\r\n      });\r\n      socket.on('chat message', function(msg){\r\n        $('#messages').append($('<li>').text(msg));\r\n      });\r\n    </script>\r\n  </body>\r\n</html>\r\n\r\n```\r\n\r\nI am trying to take value from the console and print it on the browser and vice versa. In this app the chat is between the client and the server.\r\nWhen i run the index.js file i get this on the terminal\r\n\r\nlistening on *:3000\r\n\r\nWhen i hit the **localhost:3000** on the browser and send the message from browser to client, the messaged is received successfully but when I try to send message from server(terminal) to the client(browser) i get the following error.. \r\n\r\n```\r\nnode.js:415\r\n            callback();\r\n            ^\r\nTypeError: undefined is not a function\r\n    at process._tickCallback (node.js:415:13)\r\n```\r\n\r\nHow can i solve this? I want to get the value from the console(server) and send it to the browser(client). "},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/225870599","html_url":"https://github.com/nodejs/node/issues/7296#issuecomment-225870599","issue_url":"https://api.github.com/repos/nodejs/node/issues/7296","id":225870599,"user":{"login":"sneurgaonkar","id":8036390,"avatar_url":"https://avatars.githubusercontent.com/u/8036390?v=3","gravatar_id":"","url":"https://api.github.com/users/sneurgaonkar","html_url":"https://github.com/sneurgaonkar","followers_url":"https://api.github.com/users/sneurgaonkar/followers","following_url":"https://api.github.com/users/sneurgaonkar/following{/other_user}","gists_url":"https://api.github.com/users/sneurgaonkar/gists{/gist_id}","starred_url":"https://api.github.com/users/sneurgaonkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sneurgaonkar/subscriptions","organizations_url":"https://api.github.com/users/sneurgaonkar/orgs","repos_url":"https://api.github.com/users/sneurgaonkar/repos","events_url":"https://api.github.com/users/sneurgaonkar/events{/privacy}","received_events_url":"https://api.github.com/users/sneurgaonkar/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T12:49:32Z","updated_at":"2016-06-14T12:49:32Z","body":"@tt-hub If i add the callback to the process.nextTick() function then i get the unidentified character at the \" => \" part of the code.  "}}
{"actor":{"display_login":"sneurgaonkar"}}