rethinkdb / rethinkdb-example-nodejs

137 stars 98 forks source link

Error executing nodejs(0.12.4) with koa #16

Open rohitgup14 opened 9 years ago

rohitgup14 commented 9 years ago

$ 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)

danielmewes commented 9 years ago

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

deontologician commented 9 years ago

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.

samkelleher commented 8 years ago

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.

danielmewes commented 8 years ago

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?

deontologician commented 8 years ago

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

danielmewes commented 8 years ago

@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)?

deontologician commented 8 years ago

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...