Apollo 3, Meteor and "Cannot await without a Fiber"

Hi all,

I’m been struggling for days now to update my Meteor app to use Apollo 3. After an initial hurdle (detailed here: Apollo Server 3 and Meteor - connect support dropped) for which I don’t have a nicer solution than installing express, I’m now blocked on a very frustrating problem eveyt time a resolver accesses Mongo:

"stacktrace": [
  "AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Cannot await without a Fiber",
  "    at awaitPromise (/Users/Tim/.meteor/packages/promise/.0.12.0.acrhc3.4u34++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:75:12)",
  "    at Promise.await (/Users/Tim/.meteor/packages/promise/.0.12.0.acrhc3.4u34++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:60:12)",
  "    at SynchronousCursor._nextObject (packages/mongo/mongo_driver.js:1118:38)",
  "    at SynchronousCursor.forEach (packages/mongo/mongo_driver.js:1132:22)",
  "    at SynchronousCursor.map (packages/mongo/mongo_driver.js:1142:10)",
  "    at SynchronousCursor.fetch (packages/mongo/mongo_driver.js:1166:17)",
  "    at Cursor.<computed> [as fetch] (packages/mongo/mongo_driver.js:920:44)",
  "    at MongoConnection.findOne (packages/mongo/mongo_driver.js:827:56)",
  "    at Collection.findOne (packages/mongo/collection.js:358:29)",
  "    at loginWithToken (app/api/auth/server/resolvers/mutation/login-with-token.ts:16:16)",

I have tried everything that I can think of, including:

Wrapping the apollo-server-express middleware inside Meteor.bindEnvironment before attaching it to the connect handler

Wrapping every resolver function inside Meteor.bindEnvironment before calling makeExecutableSchema.

I’m out of ideas. If I downgrade to Apollo Server 2.25.2 it works perfectly. Is anyone else here having this issue?

1 Like

I asked about Apollo 3 on the Apollo forum. In my case (Meteor/Apollo/React) I’m not using Apollo server at all. I’m no expert in how it all works, but my client communicates with my resolvers via swydo:ddp-apollo and everything works great with Apollo 3.

I don’t even really know what Apollo Server does. Do you definitely need it in your app?