this.on is not a function #20

Closed
opened 2016-03-06 19:38:27 +00:00 by nerdenough · 3 comments
nerdenough commented 2016-03-06 19:38:27 +00:00 (Migrated from github.com)

Get this stacktrace when I run the server with the basex.Session(host, port, user, pass) line.

C:\Users\Brendan\workspace\node\letterdb\node_modules\basex\index.js:220
    this.on("drain", function() {
         ^

TypeError: this.on is not a function
    at Object.Session (C:\Users\Brendan\workspace\node\letterdb\node_modules\basex\index.js:220:10)
    at Object.<anonymous> (C:\Users\Brendan\workspace\node\letterdb\app\server.js:31:22)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:141:18)
    at node.js:933:3

Node: 5.7.1 (latest)
npm: 3.6.0

Get this stacktrace when I run the server with the `basex.Session(host, port, user, pass)` line. ``` C:\Users\Brendan\workspace\node\letterdb\node_modules\basex\index.js:220 this.on("drain", function() { ^ TypeError: this.on is not a function at Object.Session (C:\Users\Brendan\workspace\node\letterdb\node_modules\basex\index.js:220:10) at Object.<anonymous> (C:\Users\Brendan\workspace\node\letterdb\app\server.js:31:22) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:141:18) at node.js:933:3 ``` Node: 5.7.1 (latest) npm: 3.6.0
apb2006 commented 2016-03-07 11:20:51 +00:00 (Migrated from github.com)

Hi,
Your report looks very similar to #17.
Can you run the examples and the tests successfully?
If yes please provide a complete code sample of the problem.
Regards /andy

Hi, Your report looks very similar to #17. Can you run the examples and the tests successfully? If yes please provide a complete code sample of the problem. Regards /andy
nerdenough commented 2016-03-07 19:46:27 +00:00 (Migrated from github.com)

Hmm, I tried the tests and they all pass except for the stress test sending 1000000 items. Additionally the examples that I tried all worked fine as well.

I have managed to fix the issue I was having though by stopping BaseX, reinstalling Node.js and your BaseX package and then starting everything up again. Not entirely sure what the issue was as my code is still the exact same as it was:

var basex = require('basex');
var basexSession = new basex.Session('localhost', 1984, 'admin', 'admin'); // error was being thrown here

Perhaps something had messed up in my Node install. Anyway thanks for the help and sorry for the trouble. This is a really great package!

Hmm, I tried the tests and they all pass except for the stress test sending 1000000 items. Additionally the examples that I tried all worked fine as well. I have managed to fix the issue I was having though by stopping BaseX, reinstalling Node.js and your BaseX package and then starting everything up again. Not entirely sure what the issue was as my code is still the exact same as it was: ``` javascript var basex = require('basex'); var basexSession = new basex.Session('localhost', 1984, 'admin', 'admin'); // error was being thrown here ``` Perhaps something had messed up in my Node install. Anyway thanks for the help and sorry for the trouble. This is a really great package!
apb2006 commented 2016-03-08 04:32:51 +00:00 (Migrated from github.com)

Pleased it now works for you . Thanks for the kind words. The package could do with a bit of a refresh. I have not really used it against recent node versions. Pull requests welcome :-)

Pleased it now works for you . Thanks for the kind words. The package could do with a bit of a refresh. I have not really used it against recent node versions. Pull requests welcome :-)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quodatum/basex-node#20
No description provided.