Big issue with async methods and promises

UI Components for Vue
Post Reply
spitzbua
Posts: 2
Joined: 21 Dec 2020, 13:52

30 Dec 2020, 11:58

Hello guys,
i have multiple problems in my code according to try to sequence functions.

if i try to make an async function in my methods part, the page stops rendering and i get the following warnings:

[Vue Router warn]: TypeError: undefined is not an object (evaluating 'modules[moduleId].call')
[Vue Router warn]: Unexpected error when starting the router:Error: Couldn't resolve component "default" at "/documentList"


is there any "best practice" or "how to" with async methods? i tried it in another page which was not that complex and there it worked out without any problems or warnings.

I also tried to chain http-methods (which were made with the axios framework) with the integrated promises and the sequence is not in the correct order. sometimes it works out, sometimes not.
here's a piece of code what i mean:
this.documentDataService.getAll()
.then(data => this.documents = data)
.then(this.companyDataService.getAll())
.then(data => this.companies = data)
according to the documentations of axios and promise this should work out

I searched the internet and the forum for one day and i didnt get any result that there was any mistake in my code.

EDIT:
the async Problem got solved after shutting everything down and restart the whole system....
the promises still not working but at least i have a workaround now...

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests