[Vuejs]-Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating '_ctx.portfolios[0].portfolioInfo') in Vue

0๐Ÿ‘

I could see from the console log that this.portfolios[0].portfolioInfo.portfolioTitle had the correct value when accessing from db, but that was because that was in the async await. The component was rendering before the async await was completed.

Adding an isLoaded variable managed in the created function and adding a v-if to the section solved the problem.

Thanks @Moritz Ringler

Leave a comment