Hi guys!
Very weird error, which suddenly occurred after removing some npm packages and stuff:
Promise.await
seems to be suddenly undefined on the server.
When I do meteor shell
in cli, and enter Promise
it works just fine:
> Promise
{ [Function: Promise]
Fiber:
{ [Function: Fiber]
yield: [Function],
current: Fiber {},
poolSize: 120,
fibersCreated: 8 },
awaitAll: [Function],
await: [Function],
async: [Function],
asyncApply: [Function] }
But inside my Meteor methods, console.log(Promise)
returns something completely different:
Promise function Promise(executor){
anInstance(this, $Promise, PROMISE, '_h');
aFunction(executor);
Internal.call(this);
try {
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
} catch(err){
$reject.call(this, err);
}
}
How is this even possible?!
Also very weird:
In my Meteor method I do:
let promise = new Promise( (resolve, reject) => { ... } );
return Promise.await(promise);
and the error in server console is:
[Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.]
Exception while invoking method 'placeOpenOrder' TypeError: _Promise.await is not a function
Notice the _Promise.await instead of Promise.await … is this normal?
Please help, wtf is going on?!