Recently I’ve switched an app from compiling async functions to just letting them use the normal async syntax… but I’ve started to get Expression is of type asyncfunction, not function
from FB.
sdk functions, for example, calling FB.login(async () => {})
will throw that exception… So I’m wondering if its possible to either
- 1 – forbid async expressions (?) in some static way (typescript?) for the FB object
- 2 – get facebook to not do weird stuff.. they shouldn’t need to care if its a fn expr or an async fn expr (or a generator, or any other thing we might invent)
Note: the current solution I have is just to wrap the fn FB.login((data) => (async () => {...}))
and add a comment explaining why its being wrapped, but its kinda fragile since anyone could call these anywhere else in the codebase not being aware of the issue