Closed achiko closed 6 years ago
Fellow vuejs-er here. What is the issue/error that you're actually seeing btw?
@achiko , @rahulrumalla -- could you give me a little more context? Are you seeing this when you try to create a loan request? In that case, you could use:
LoanRequest.create(dharma, {
...loanOptions,
}).then((loanRequest) => {
// continue here...
});
I'd guess this is a misleading error by IDE plugin. I remember this message from when I missed the 'async' keyword on the function.
Yes, you definitely would need to have async
on the function to use await
! Like so:
(async (input) => {
await doSomethingAsync(input);
})();
Closing for now, let me know if you still think this is a problem. Good luck!
Sorry for a late reply I have just pushed repo: https://github.com/achiko/vue-dharma Please look at https://github.com/achiko/vue-dharma/blob/master/src/components/Loanrequest.vue
I have implemented the Promis eversion : https://github.com/achiko/vue-dharma/blob/master/src/components/Loanrequest.vue#L43
And Async Await version : https://github.com/achiko/vue-dharma/blob/master/src/components/Loanrequest.vue#L63
Now I'm getting the following error:
xml-http-request.js?37da:91 Uncaught (in promise) TypeError: Cannot read property 'node' of undefined
at new XMLHttpRequest (xml-http-request.js?37da:91)
at HttpProvider.prepareRequest (httpprovider.js?f85f:61)
at HttpProvider.sendAsync (httpprovider.js?f85f:116)
at RequestManager.sendAsync (requestmanager.js?111b:80)
at Object.send (method.js?7c38:141)
at eval (index.js?10a5:46)
at new Promise (
Is this Vue.js issue? is Dharmajs compatible with Vue ?
25 | methods: { 26 | createLoanRequest: function() {