arunoda / meteor-smart-collections

Meteor Collections Re-Imagined
MIT License
147 stars 13 forks source link

Error using Smartcollections #26

Closed shinank closed 11 years ago

shinank commented 11 years ago

I am getting this error when I add smart-collections to my project and configured my app to use them

W20130829-22:19:39.970(-5)? (STDERR) events.js:71 W20130829-22:19:40.084(-5)? (STDERR) throw arguments[1]; // Unhandled 'error' event W20130829-22:19:40.084(-5)? (STDERR) ^ W20130829-22:19:40.085(-5)? (STDERR) TypeError: Cannot call method 'added' of undefined W20130829-22:19:40.087(-5)? (STDERR) at Query.snapshot (packages/smart-collections/lib/query.js:200) W20130829-22:19:40.088(-5)? (STDERR) at Cursor.each (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/cursor.js:244:9) W20130829-22:19:40.089(-5)? (STDERR) at Cursor.nextObject (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/cursor.js:678:5) W20130829-22:19:40.089(-5)? (STDERR) at Cursor.nextObject.commandHandler (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/cursor.js:658:14) W20130829-22:19:40.089(-5)? (STDERR) at Db._executeQueryCommand (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/db.js:1670:9) W20130829-22:19:40.090(-5)? (STDERR) at Server.Base._callHandler (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/connection/base.js:382:41) W20130829-22:19:40.091(-5)? (STDERR) at Server.connect.connectionPool.on.server._serverState (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:472:18) W20130829-22:19:40.091(-5)? (STDERR) at MongoReply.parseBody (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) W20130829-22:19:40.096(-5)? (STDERR) at Server.connect.connectionPool.on.server._serverState (/home/shinank/.meteorite/packages/smart-collections/arunoda/meteor-smart-collections/c497bdc8fcec8bfe45b456c28822d80466f1b798/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:430:20) W20130829-22:19:40.099(-5)? (STDERR) at EventEmitter.emit (events.js:96:17)

arunoda commented 11 years ago

Can you please help me to debug this? Can you please modify the SC a bit as shown below.


Can you post the logs after that. Then I can give a proper fix.

arunoda commented 11 years ago

I've updated with a suggested fix. Try the latest(0.3.3) version too

shinank commented 11 years ago

0.3.3 didnt work.

I added the 2 lines to query.js. Here is the output: W20130830-21:27:20.186(-5)? (STDERR) /home/shinank/.meteor/tools/3cba50c44a/lib/nodemodules/fibers/future.js:173 W20130830-21:27:20.186(-5)? (STDERR) throw(ex); W20130830-21:27:20.187(-5)? (STDERR) ^ W20130830-21:27:20.191(-5)? (STDERR) TypeError: undefined is not a function W20130830-21:27:20.191(-5)? (STDERR) at app/lib/collections/collections.js:4:18 W20130830-21:27:20.198(-5)? (STDERR) at app/lib/collections/collections.js:11:3 W20130830-21:27:20.200(-5)? (STDERR) at mains (/home/shinank/meteor-projects/carpool/.meteor/local/build/programs/server/boot.js:153:10) W20130830-21:27:20.200(-5)? (STDERR) at Array.forEach (native) W20130830-21:27:20.200(-5)? (STDERR) at Function..each._.forEach (/home/shinank/.meteor/tools/3cba50c44a/lib/node_modules/underscore/underscore.js:79:11) W20130830-21:27:20.200(-5)? (STDERR) at /home/shinank/meteor-projects/carpool/.meteor/local/build/programs/server/boot.js:80:5

arunoda commented 11 years ago

Seems like this is, some other issue. Anyway, here the modified file with logs.

Replace packages/smart-collections/lib/query.js with this - https://gist.github.com/arunoda/aa5aec1ff2757fa7baa9

shinank commented 11 years ago

I used that file but getting this error when i startup my app Your app is crashing. Here's the latest log.

W20130830-21:45:28.472(-5)? (STDERR) /home/shinank/.meteor/tools/3cba50c44a/lib/nodemodules/fibers/future.js:173 W20130830-21:45:28.473(-5)? (STDERR) throw(ex); W20130830-21:45:28.474(-5)? (STDERR) ^ W20130830-21:45:28.485(-5)? (STDERR) TypeError: undefined is not a function W20130830-21:45:28.486(-5)? (STDERR) at app/lib/collections/collections.js:4:18 W20130830-21:45:28.487(-5)? (STDERR) at app/lib/collections/collections.js:11:3 W20130830-21:45:28.490(-5)? (STDERR) at mains (/home/shinank/meteor-projects/carpool/.meteor/local/build/programs/server/boot.js:153:10) W20130830-21:45:28.490(-5)? (STDERR) at Array.forEach (native) W20130830-21:45:28.491(-5)? (STDERR) at Function..each._.forEach (/home/shinank/.meteor/tools/3cba50c44a/lib/node_modules/underscore/underscore.js:79:11) W20130830-21:45:28.498(-5)? (STDERR) at /home/shinank/meteor-projects/carpool/.meteor/local/build/programs/server/boot.js:80:5 => Exited with code: 1 => Your application is crashing. Waiting for file change.

arunoda commented 11 years ago

I really not sure, what's happening here.

Check your spellings on your collections.js file Check Smart-Collections has been added do this also meteor add smart-collections

On Sat, Aug 31, 2013 at 8:16 AM, shinank notifications@github.com wrote:

I used that file but getting this error when i startup my app Your app is crashing. Here's the latest log.

W20130830-21:45:28.472(-5)? (STDERR) /home/shinank/.meteor/tools/3cba50c44a/lib/nodemodules/fibers/future.js:173 W20130830-21:45:28.473(-5)? (STDERR) throw(ex); W20130830-21:45:28.474(-5)? (STDERR) ^ W20130830-21:45:28.485(-5)? (STDERR) TypeError: undefined is not a function W20130830-21:45:28.486(-5)? (STDERR) at app/lib/collections/collections.js:4:18 W20130830-21:45:28.487(-5)? (STDERR) at app/lib/collections/collections.js:11:3 W20130830-21:45:28.490(-5)? (STDERR) at mains (/home/shinank/meteor-projects/carpool/.meteor/local/build/programs/server/boot.js:153:10) W20130830-21:45:28.490(-5)? (STDERR) at Array.forEach (native) W20130830-21:45:28.491(-5)? (STDERR) at Function..each._.forEach (/home/shinank/.meteor/tools/3cba50c44a/lib/node_modules/underscore/underscore.js:79:11) W20130830-21:45:28.498(-5)? (STDERR) at /home/shinank/meteor-projects/carpool/.meteor/local/build/programs/server/boot.js:80:5 => Exited with code: 1 => Your application is crashing. Waiting for file change.

— Reply to this email directly or view it on GitHubhttps://github.com/arunoda/meteor-smart-collections/issues/26#issuecomment-23599369 .

Arunoda Susiripala

@arunoda http://twitter.com/arunoda http://gplus.to/arunodahttps://github.com/arunoda http://www.linkedin.com/in/arunoda

shinank commented 11 years ago

Ok Sorry for the trouble. I had several isses on my end.

  1. I am using 0.3.3 version of SmartCollections
  2. I am using the query.js from https://gist.github.com/arunoda/aa5aec1ff2757fa7baa9

Here is the output: I20130831-07:51:28.589(-5)? LOOP { observer: I20130831-07:51:28.589(-5)?  { _fields: undefined, I20130831-07:51:28.589(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.589(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.589(-5)? LOOP { observer: I20130831-07:51:28.589(-5)?  { _fields: undefined, I20130831-07:51:28.589(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.589(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.590(-5)? LOOP { observer: I20130831-07:51:28.590(-5)?  { _fields: undefined, I20130831-07:51:28.590(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.590(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.591(-5)? LOOP { observer: I20130831-07:51:28.591(-5)?  { _fields: undefined, I20130831-07:51:28.591(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.591(-5)?  callback: [Function: afterAdded] } W20130831-07:51:28.592(-5)? (STDERR) events.js:71 W20130831-07:51:28.592(-5)? (STDERR)  throw arguments[1]; // Unhandled 'error' event W20130831-07:51:28.592(-5)? (STDERR)  ^ W20130831-07:51:28.597(-5)? (STDERR) TypeError: Cannot call method 'changed' of undefined W20130831-07:51:28.597(-5)? (STDERR)  at Query._rawChanged.cachedDoc (packages/smart-collections/lib/query.js:134) W20130831-07:51:28.597(-5)? (STDERR)  at Array.forEach (native) W20130831-07:51:28.598(-5)? (STDERR)  at Query._rawChanged (packages/smart-collections/lib/query.js:133) W20130831-07:51:28.598(-5)? (STDERR)  at Query.snapshot (packages/smart-collections/lib/query.js:207) W20130831-07:51:28.598(-5)? (STDERR)  at Cursor.each (/home/shinank/meteor-projects/carpool/packages/smart-collections/.build/npm/node_modules/mongodb/lib/mongodb/cursor.js:244:9) W20130831-07:51:28.598(-5)? (STDERR)  at Cursor.nextObject (/home/shinank/meteor-projects/carpool/packages/smart-collections/.build/npm/node_modules/mongodb/lib/mongodb/cursor.js:678:5) W20130831-07:51:28.598(-5)? (STDERR)  at Cursor.nextObject.commandHandler (/home/shinank/meteor-projects/carpool/packages/smart-collections/.build/npm/node_modules/mongodb/lib/mongodb/cursor.js:658:14) W20130831-07:51:28.599(-5)? (STDERR)  at Db._executeQueryCommand (/home/shinank/meteor-projects/carpool/packages/smart-collections/.build/npm/node_modules/mongodb/lib/mongodb/db.js:1670:9) W20130831-07:51:28.600(-5)? (STDERR)  at Server.Base._callHandler (/home/shinank/meteor-projects/carpool/packages/smart-collections/.build/npm/node_modules/mongodb/lib/mongodb/connection/base.js:382:41) W20130831-07:51:28.600(-5)? (STDERR)  at Server.connect.connectionPool.on.server._serverState (/home/shinank/meteor-projects/carpool/packages/smart-collections/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:472:18) I20130831-07:51:28.607(-5)? LOOP { observer: I20130831-07:51:28.608(-5)?  { _fields: undefined, I20130831-07:51:28.608(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.609(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.611(-5)? LOOP { observer: I20130831-07:51:28.612(-5)?  { _fields: undefined, I20130831-07:51:28.612(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.612(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.613(-5)? LOOP { observer: I20130831-07:51:28.613(-5)?  { _fields: undefined, I20130831-07:51:28.618(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.619(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.621(-5)? LOOP { observer: I20130831-07:51:28.621(-5)?  { _fields: undefined, I20130831-07:51:28.621(-5)?  _callbacks: { added: [Function], changed: [Function], removed: [Function] } }, I20130831-07:51:28.624(-5)?  callback: [Function: afterAdded] } I20130831-07:51:28.624(-5)? LOOP { observer: I20130831-07:51:28.624(-5)?  { _fields: undefined,

arunoda commented 11 years ago

I need the complete log from the start of the app. Can you please paste here and send me a link

arunoda commented 11 years ago

Try this version - https://gist.github.com/arunoda/4bcdad426d58542914a0 for the query.js

shinank commented 11 years ago

That worked perfectly. No more errors in the log. Thanks!

arunoda commented 11 years ago

Cool. I'll merge this fix in a release :)

On Sun, Sep 1, 2013 at 12:57 AM, shinank notifications@github.com wrote:

That worked perfectly. No more errors in the log. Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/arunoda/meteor-smart-collections/issues/26#issuecomment-23612363 .

Arunoda Susiripala

@arunoda http://twitter.com/arunoda http://gplus.to/arunodahttps://github.com/arunoda http://www.linkedin.com/in/arunoda

arunoda commented 11 years ago

released as 0.3.5

shinank commented 11 years ago

Thanks Again! I appreciate your help.

On 8/31/13, Arunoda Susiripala notifications@github.com wrote:

released as 0.3.5


Reply to this email directly or view it on GitHub: https://github.com/arunoda/meteor-smart-collections/issues/26#issuecomment-23617385

Shinan S. Kassam

arunoda commented 11 years ago

Np. It was a bug :)

On Sun, Sep 1, 2013 at 7:17 AM, shinank notifications@github.com wrote:

Thanks Again! I appreciate your help.

On 8/31/13, Arunoda Susiripala notifications@github.com wrote:

released as 0.3.5


Reply to this email directly or view it on GitHub:

https://github.com/arunoda/meteor-smart-collections/issues/26#issuecomment-23617385

Shinan S. Kassam

— Reply to this email directly or view it on GitHubhttps://github.com/arunoda/meteor-smart-collections/issues/26#issuecomment-23617442 .

Arunoda Susiripala

@arunoda http://twitter.com/arunoda http://gplus.to/arunodahttps://github.com/arunoda http://www.linkedin.com/in/arunoda