Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Meteor 1.3.2.4 #10

Closed
manhhailua opened this issue Apr 22, 2016 · 2 comments
Closed

Error with Meteor 1.3.2.4 #10

manhhailua opened this issue Apr 22, 2016 · 2 comments

Comments

@manhhailua
Copy link

import {ReactiveAggregate} from 'meteor/jcbernack:reactive-aggregate';

This is my publish function.

Meteor.publish('skills', () => {
return ReactiveAggregate(this, Skills, [
{$match: {status: 'active'}},
{$limit: 10}
]);
});

And in the meteor console I got this:
I20160422-16:12:21.076(7)? Exception from sub skills id RE76noLCSJ2LeaYeh TypeError: Object [object global] has no method 'added'
I20160422-16:12:21.078(7)? at packages/jcbernack_reactive-aggregate/aggregate.js:17:1
I20160422-16:12:21.079(7)? at Array.forEach (/home/manhpt/.meteor/packages/es5-shim/.4.5.10.ajfzqv++os+web.browser+web.cordova/npm/node_modules/es5-shim/es5-shim.js:435:21)
I20160422-16:12:21.080(7)? at update (packages/jcbernack_reactive-aggregate/aggregate.js:15:1)
I20160422-16:12:21.081(7)? at ReactiveAggregate (packages/jcbernack_reactive-aggregate/aggregate.js:47:1)
I20160422-16:12:21.083(7)? at Subscription._handler (imports/api/skills.js:20:12)
I20160422-16:12:21.084(7)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1704:12)
I20160422-16:12:21.085(7)? at Subscription._runHandler (packages/ddp-server/livedata_server.js:1026:17)
I20160422-16:12:21.086(7)? at Session._startSubscription (packages/ddp-server/livedata_server.js:845:9)
I20160422-16:12:21.088(7)? at Session.sub (packages/ddp-server/livedata_server.js:617:12)
I20160422-16:12:21.089(7)? at packages/ddp-server/livedata_server.js:551:43

My app was fine but the result of subscribe method became empty. The problem happend the same to collection:users Meteor.users.

@JcBernack
Copy link
Owner

You can't use the ES6 arrow function here, use a normal function because the this-context is needed.

Am 22.04.2016 um 11:28 schrieb Mạnh Hai Lúa notifications@github.com:

import {ReactiveAggregate} from 'meteor/jcbernack:reactive-aggregate';

This is my publish function.

Meteor.publish('skills', () => {
return ReactiveAggregate(this, Skills, [
{$match: {status: 'active'}},
{$limit: 10}
]);
});

And in the meteor console I got this:
I20160422-16:12:21.076(7)? Exception from sub skills id RE76noLCSJ2LeaYeh TypeError: Object [object global] has no method 'added'
I20160422-16:12:21.078(7)? at packages/jcbernack_reactive-aggregate/aggregate.js:17:1
I20160422-16:12:21.079(7)? at Array.forEach (/home/manhpt/.meteor/packages/es5-shim/.4.5.10.ajfzqv++os+web.browser+web.cordova/npm/node_modules/es5-shim/es5-shim.js:435:21)
I20160422-16:12:21.080(7)? at update (packages/jcbernack_reactive-aggregate/aggregate.js:15:1)
I20160422-16:12:21.081(7)? at ReactiveAggregate (packages/jcbernack_reactive-aggregate/aggregate.js:47:1)
I20160422-16:12:21.083(7)? at Subscription._handler (imports/api/skills.js:20:12)
I20160422-16:12:21.084(7)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1704:12)
I20160422-16:12:21.085(7)? at Subscription._runHandler (packages/ddp-server/livedata_server.js:1026:17)
I20160422-16:12:21.086(7)? at Session._startSubscription (packages/ddp-server/livedata_server.js:845:9)
I20160422-16:12:21.088(7)? at Session.sub (packages/ddp-server/livedata_server.js:617:12)
I20160422-16:12:21.089(7)? at packages/ddp-server/livedata_server.js:551:43

My app was fine but the result of subscribe method became empty. The problem happend the same to collection:users Meteor.users.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@manhhailua
Copy link
Author

Thank you! Problem's solved!
Hope you will update this package soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants