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 was archived by the owner on Jun 10, 2019. It is now read-only.
1constcid=awaitgetCid(slackUsername)2awaitreplyFn(`Creating time report for ${year}${month} and ${cid}`)3constresp=awaitrequest.post(config.apiUrl+`/create-time-report/${cid}/${year}/${month}`)
And I got this strange error that cid was undefined on line 3, but it was defined properly on line 2.
After a lot of crying i looked into the generated code and i found that it had been transpiled to:
1returnPromise.resolve().then(function(){2returngetCid(slackUsername);3}).then(function(_resp){4constcid=_resp;5returnreplyFn(`Creating time report for ${year}${month} and ${cid}`);6}).then(function(){7returnrequest.post(config.apiUrl+`/create-time-report/${cid}/${year}/${month}`)8})
As is clear from the transpiled code cid goes out of scope prematurely.
I had this code:
And I got this strange error that
cidwas undefined on line 3, but it was defined properly on line 2.After a lot of crying i looked into the generated code and i found that it had been transpiled to:
As is clear from the transpiled code
cidgoes out of scope prematurely.I am running version 1.0.5 of async-to-promises.