Skip to content

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

Closed

Description

@heeepi
'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.

Activity

  1. patriksimek commented on Mar 9, 2017

    @patriksimek
    Collaborator

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

  2. vhain commented on Mar 9, 2017

    @vhain

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

  3. patriksimek commented on Mar 11, 2017

    @patriksimek
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions