Are you definitely using inbuilt Meteor Promises? I’ve had no issues with those, but popular Promise libraries (like Bluebird) don’t play nicely with fibers.
I see. I’m using a npm library so I guess no. More precisely I’m doing:
const Things = new Mongo.Collection('edges', { idGeneration: 'MONGO' });
const _things = Things._collection.rawCollection();
const bulk = _things.initializeUnorderedBulkOp();
... add things to do in bulk
await bulk.execute(); // this doesn't work well with the fiber
I’m striking the same problem right now. I am using meteor add promise already.
I wonder if it has to do that Meteor 1.4.3 (I think) required us to switch to babel-runtime (using Babel transform-runtime plugin) which might be breaking the extension of Promise? Hmmm… that might be it as console.log(Promise.await) logs undefined, and @benjamn’s library should have added that function onto Promise.
I’ve gotten around it for the moment (super ugly I know) by declaring const MPromise = global.Package['promise'].Promise and then using MPromise.await(...) instead of await ..., and removing async off those functions.
Solved it for my situation. After reading this README all was revealed.
I had the following at the top of my .babelrc:
"presets": [
"react",
"es2015",
"stage-3"
],
Turns out Meteor adds it’s own presets which cover all of these features. As soon as I removed these presets async/await started working. Note: I still have plugins in my .babelrc.
Problem is now, my .babelrc is broken for all other tools reading my code (WallabyJS for example).