Server side call to async method returns Promise object, not value. #8367
Milestone
Comments
I'm seeing this as well. |
As a workaround, I exported the method function and imported it where I was using it on the server (in another method), then used |
This issue should (finally!) be resolved if you run |
benjamn
added a commit
that referenced
this issue
Mar 17, 2017
Works like a charm - thank you @benjamn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer to this post on the Meteor forums and to @benjamn's comments which follow on.
In a nutshell, a
Meteor.call
done on the server does not get the return value of an async method. Instead, it gets the Promise object. This is at variance with the expected behaviour.This has been observed since v1.3, but the reproduction uses v1.4.2.6:
Reproduction:
The server's console log shows the result of calling the async method (shows
{}
- expected "42"):The client browser shows the result of calling the async method from the client (shows "42" as expected):
The text was updated successfully, but these errors were encountered: