Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 7.7.2 TypeError: "listener" argument must be a function #425

Closed
heeepi opened this issue Mar 9, 2017 · 3 comments
Closed

Node 7.7.2 TypeError: "listener" argument must be a function #425

heeepi opened this issue Mar 9, 2017 · 3 comments

Comments

@heeepi
Copy link

heeepi commented Mar 9, 2017

'use strict';
let config = {
  user: sql_user,
  password: sql_psw,
  server: sql_server,
  database: sql_database
}
let sql = require('mssql');
let query = 'select * from t1';

let connection = new sql.Connection(config)
connection.connect()
    .then((conn) => {
      return new sql.Request(conn)
        .query(query)
        .then(function (data) {
          // ...
        })
    })
    .catch((err) => {
      console.log(err);
    });

Node 7.7.1 work fine. Node 7.7.2 throw error:

TypeError: "listener" argument must be a function
    at Socket.once (events.js:307:11)
    at Socket.connect (net.js:943:10)
    at Connection.connectOnPort (\node_modules\tedious\lib\connection.js:429:19)
    at \node_modules\tedious\lib\connection.js:411:27
    at Socket.onMessage (\node_modules\tedious\lib\instance-lookup.js:28:14)
    at emitTwo (events.js:106:13)
    at Socket.emit (events.js:194:7)
    at UDP.onMessage [as onmessage] (dgram.js:546:8)

I thing, this error caused by b56e851c48 commit.

@patriksimek
Copy link
Collaborator

Thanks, this originates in Tedious, but I don't understand what's wrong atm. I will investigate the issue.

@vhain
Copy link

vhain commented Mar 9, 2017

It can be bug of Node 7.7.2. If yes, it should be solved by nodejs/node#11762

@patriksimek
Copy link
Collaborator

Discussed directly in tedious here: tediousjs/tedious#532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants