1
votes

In my node express js project I am running a http server (i.e... http.createServer(app)).. (uisng bodyParser, morgan, serve-favicon, express-jwt middilwares).. When the user select any line in the command prompt (using mouse, Command title also prefixed with the word "Select"), the express http server is not serving any further request until i hit an enter(return key) to cancel/finish the selection.

I am not using any "readline" module...

Anyone Please share me your view on this issues..

1

1 Answers

2
votes

IMHO, it is probably because the I/O of the command prompt (console ?) aren't asynchronous. You need to handle the asynchronous way to do what you want to do in node. It means that parts of the code are (probably) blocking.

Some explanations here on another SO post about that. According to the documentation about the console here "it should be a very rare occurrence indeed that a write blocks, but it is possible."

As Node is made with low level C, it is possible that the system waits for a validate, after you start to write something in the command prompt.

I had a similar problem with logs.