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

Socket creation error on Node version 7.7.2 #532

Closed
yasen-atanasov opened this issue Mar 9, 2017 · 5 comments
Closed

Socket creation error on Node version 7.7.2 #532

yasen-atanasov opened this issue Mar 9, 2017 · 5 comments

Comments

@yasen-atanasov
Copy link

Hi,

Upgrading to node v.7.7.2 on Windows results in this error when trying to use Tedious:

events.js:307
    throw new TypeError('"listener" argument must be a function');
    ^

TypeError: "listener" argument must be a function
    at Socket.once (events.js:307:11)
    at Socket.connect (net.js:943:10)
    at Connection.connectOnPort (c:\wrk\xogito\ussquash\usq_api\node_modules\tedious\lib\connection.js:429:19)
    at Connection.connect (c:\wrk\xogito\ussquash\usq_api\node_modules\tedious\lib\connection.js:402:21)
    at Connection.initialiseConnection (c:\wrk\xogito\ussquash\usq_api\node_modules\tedious\lib\connection.js:77:12)
    at Connection.enter (c:\wrk\xogito\ussquash\usq_api\node_modules\tedious\lib\connection.js:975:19)
    at Connection.transitionTo (c:\wrk\xogito\ussquash\usq_api\node_modules\tedious\lib\connection.js:508:33)
    at new Connection (c:\wrk\xogito\ussquash\usq_api\node_modules\tedious\lib\connection.js:66:10)

Going to row 429 in tedious/lib/connection.js and adding an empty function as a second parameter to the socket.connect call resolves the issue. I'm not sure whether this is a nodejs or tedious problem.

For the time being I've downgraded node to 7.7.1

@arthurschreiber
Copy link
Collaborator

I think this will be fixed with the upcoming 1.15.0 release.

@vhain
Copy link

vhain commented Mar 9, 2017

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

@BarryCarlyon
Copy link

I have the some problen with node 7.7.0 and 7.7.2 and it's affecting a LOT of modules…

(Redis for example)

@jdanyow
Copy link
Contributor

jdanyow commented Mar 14, 2017

For me this is an issue in node v7.7.2. It worked in node v7.7.1.

In connection.js, connectOnPort calls socket.connect with one arg:

image

But socket.connect can't handle the second arg being undefined:

image

Appears to be fixed by:

nodejs/node@c6cbbf9

@tvrprasad
Copy link
Contributor

This issue does not exist in Tedious 1.15.0 which got released just a few days back. You may want to upgrade.

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

No branches or pull requests

6 participants