[Vuejs]-Vue3: Can't fetch when page reloaded, but can fetch when redirected

0👍

You didn’t show what’s happening in your Vuex.

Also you’re importing computed from @vue/runtime-core.

The docs said it’s not for app use i.e internal use only.

Docs: https://www.npmjs.com/package/@vue/runtime-core

Next, assign an empty string instead as default value instead of undefined or at least check in the template if currentUser.last_name.

You have {{ currentUser.last_name.toUpperCase() }} in your template and the error says

ProfilePage.vue:6 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘toUpperCase’)

Here’s a working codesandbox: https://codesandbox.io/s/https-stackoverflow-com-questions-73912912-6f6syv

Leave a comment