You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 5, 2018. It is now read-only.
For me it's something to do with async/await and Promise. async/await is being compiled to something that uses asyncGeneratorFunction from babel-runtime's helpers and there's a Promise inside of it. For me, that Promise is not wrapped with a Fiber as it'd normally be in Meteor's environment.
The text was updated successfully, but these errors were encountered:
davidyaha
changed the title
Runs outside Fiber
Runs outside Fiber while using inside a Meteor package
Sep 3, 2017
As you can see, USE_NATIVE value is boolean that tells if it should use native Promise or a polyfill.
I did some deep digging and it seems like at the time when an anonymous function executes to return a value for USE_NATIVE, there is a Promise available and it's wrapped with Fiber which is what we're looking for.
USE_NATIVE should be true but it's false. It happens because inside the try/catch an error occurs.
TypeError: es6PromiseThen.call is not a function
It points to this part of a code from meteor-promise package:
Thanks for the research @kamilkisiela!
I've actually faced this issue myself in a recent project (not in a package) and have just used the rawCollection() function of the meteor collection in order to get the native mongo driver Collection object and then ran my queries as documented by mongo.
I guess there is not much we can do here but wait to 1.6 to release and it will just give us a free fix :)
Leaving this open for anyone else that faces this issue.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue
The issue occurs when using
@accounts/graphql-api
inside of a meteor package. If we'd create the same logic but inside an app, it'd work.Gives:
Reproduction
Run it and go to
http://localhost:3000
. It should display SUCCESS or FAILURE.Failure:
Meteor@
1.5.2
or lesshttps://github.com/kamilkisiela/js-accounts-meteor-fiber/tree/failure
Success:
Meteor@
1.6-alpha.0
at leasthttps://github.com/kamilkisiela/js-accounts-meteor-fiber/tree/success
Differences
kamilkisiela/js-accounts-meteor-fiber@failure...success
Idea
For me it's something to do with
async/await
andPromise
.async/await
is being compiled to something that usesasyncGeneratorFunction
from babel-runtime's helpers and there's aPromise
inside of it. For me, thatPromise
is not wrapped with aFiber
as it'd normally be in Meteor's environment.The text was updated successfully, but these errors were encountered: