rethinkdb-example-nodejs icon indicating copy to clipboard operation
rethinkdb-example-nodejs copied to clipboard

Error executing nodejs(0.12.4) with koa

Open rohitgup14 opened this issue 10 years ago • 7 comments

$ node --harmony app.js //rethinkdb-example-nodejs/todo-angular-koa/node_modules/rethinkdb/ast.js:127 if (!options.noreply && typeof callback !== 'function') { ^ TypeError: Cannot read property 'noreply' of undefined at IndexWait.TermBase.run (//rethinkdb-example-nodejs/todo-angular-koa/node_modules/rethinkdb/ast.js:127:17) at //rethinkdb-example-nodejs/todo-angular-koa/app.js:128:45 at TcpConnection. (//rethinkdb-example-nodejs/todo-angular-koa/node_modules/rethinkdb/net.js:78:16) at TcpConnection.g (events.js:199:16) at TcpConnection.emit (events.js:104:17) at Socket.handshake_callback (//rethinkdb-example-nodejs/todo-angular-koa/node_modules/rethinkdb/net.js:459:23) at Socket.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:163:16) at Socket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:538:20)

rohitgup14 avatar Aug 20 '15 00:08 rohitgup14

Thanks for the report @rohitgup14. That's weird. @deontologician any ideas?

danielmewes avatar Aug 20 '15 20:08 danielmewes

This tutorial is pretty out of date, it has a RethinkDB 1.12 driver dependency. It's possible more recent versions have fixed this bug. It seems not to be checking if options is null, which would come up all the time.

deontologician avatar Aug 21 '15 00:08 deontologician

Same error here running on node v4. The todo-angular-express-promise app gives this error Cannot read property 'noreply' of undefined on startup and is using version 2.0 of the driver, while the todo-angular-express works without problems - which interestingly is using a much older driver version (1.12.0).

Updated

todo-angular-express will continue to work when updated to the latest driver. The -promise version will also start to work when updated to the latest 2.1 driver. However, it needs some work as creating the new todos results in empty line items until the page is refreshed.

I'll stop back later to investigate.

samkelleher avatar Oct 05 '15 10:10 samkelleher

Thanks for letting us know @samkelleher. Once you get things running with the latest driver, a pull request would be amazing so we can merge it into the example code :-)

@deontologician About the original issue: Do you think we could just bump the angular/koa example to using the latest driver?

danielmewes avatar Oct 05 '15 23:10 danielmewes

I've bumped it and made it unbounded (not advised in general, but this is for a tutorial). I think longterm we should integrate these tutorials into our test-suite for new releases or deprecate them

deontologician avatar Oct 05 '15 23:10 deontologician

@deontologician Fair enough. Did you check that the code actually works with the new driver (in case we changed the syntax or name of some command)?

danielmewes avatar Oct 06 '15 00:10 danielmewes

Nope, I just bumped it up. @samkelleher's comment suggests that it doesn't actually work, but since it didn't work anyway, the situation isn't really worse...

deontologician avatar Oct 06 '15 01:10 deontologician