txns.Store.js:139 - TypeError: Cannot read property 'length' of undefined #184

Closed
ile opened this Issue Dec 9, 2012 · 6 comments

Projects

None yet

4 participants

@ile
ile commented Dec 9, 2012

Maybe this should be in Racer issues, but since I got this using Derby, I'm putting it here.

I seem to get this quite often. I haven't pinpointed yet exactly when. Will update if I get more information. The error goes into the ssh terminal, so it's on the server side, not browser.

I have the latest source code from Github.

/home/ile/myapp/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:139
          var k = list.length;
                      ^
TypeError: Cannot read property 'length' of undefined
    at tmp (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:139:23)
    at Store.serialEmit (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:158:13)
    at PubSub.module.exports.events.init (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:50:19)
    at PubSub.EventEmitter.emit (events.js:99:17)
    at emitAll (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/adapters/pubsub-memory/channel-interface-string.js:97:12)
    at Function.intf.publish (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/adapters/pubsub-memory/channel-interface-string.js:43:16)
    at PubSub.publish (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/pubSub/PubSub.js:56:10)
    at publishFn (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/descriptor/query/QueryHub.js:176:10)
    at QueryHub.publish (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/descriptor/query/QueryHub.js:154:13)
    at PaginatedQueryNode.shouldPublish (/home/ile/myapp/node_modules/derby/node_modules/racer/lib/descriptor/query/PaginatedQueryNode.js:162:16)
@lefnire
lefnire commented Dec 9, 2012

you have latest source for derby, also using the latest racer source? (see using edge)

@ile
ile commented Dec 9, 2012

I have git cloned both, today, I think they should be the latest ones.

Thanks for the edge tip, that will be handy at some point I'm sure.

I could maybe come up with some source code to replicate the error if I can reproduce it enough times. Now it has happened just once in a while. So I guess this report is more of a "FYI" at this point.

@triptec
triptec commented Mar 3, 2013

ile, were you subscribing to a query using limit()?

@ile
ile commented Mar 3, 2013

I'm not 100% sure, but I now looked at some old version in the version control, and it seems there was limit() used in the query.

I haven't seen this error for a long time though, so maybe it's not relevant anymore, I don't know.

@triptec
triptec commented Mar 4, 2013

I use a simple sort and limit like so:

store.query.expose('snippets', 'last', function () {
  query = this.sort(['date','desc']).limit(2);
  return query;
});

It works just fine first but when I add a snippet to 'snippets' it breaks down with:

TypeError: Cannot read property 'length' of undefined
    at tmp (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/txns/txns.Store.js:139:23)
    at Store.serialEmit (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/txns/txns.Store.js:169:13)
    at PubSub.module.exports.events.init (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/pubSub/pubSub.Store.js:40:24)
    at PubSub.EventEmitter.emit (events.js:96:17)
    at emitAll (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/adapters/pubsub-memory/channel-interface-string.js:97:12)
    at Function.intf.publish (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/adapters/pubsub-memory/channel-interface-string.js:47:16)
    at PubSub.publish (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/pubSub/PubSub.js:63:10)
    at publishFn (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/descriptor/query/QueryHub.js:176:10)
    at publishRmDoc (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/descriptor/query/QueryHub.js:186:3)
    at QueryHub.publish (/Users/frasse/Documents/Development/Node.js/derby/derby-learn-by-example/node_modules/racer/lib/descriptor/query/QueryHub.js:165:13)
frasses-mac:derby-learn-by-example frasse$ 
@nateps
Collaborator
nateps commented Jun 5, 2013

Not relevant in 0.5

@nateps nateps closed this Jun 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment