I’m having troubles when fetching results from a collection find. When I try to fetch the find results I get the following error:
Error: Can’t wait without a fiber
Any suggestions?
import { Meteor } from 'meteor/meteor';
import FB from 'fb';
import Customers from './collections/customers';
FB.mapi = Meteor.wrapAsync(FB.napi);
Meteor.methods({
'facebookImport': function(access_token) {
//SYNC - Get facebook user info
let res = FB.mapi('me', {
fields: [
'id',
'name',
'email',
],
access_token: access_token
});
//Get user's books
FB.api('me/books', {
fields:['data'],
access_token: access_token
}, function(res) {
// console.log(res);
console.log(Customers);
let a = Customers.find({id: res.id}).fetch();
console.log(a);
});
}
});