Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'title')
Vue version
3.3.6
Link to minimal reproduction
https://github.com/tomright/todoVue3Vuex
Steps to reproduce
- Open the main page in Live Server or another plugin for launching sites
- Click "vuex Posts"
- Open any post with the "Open Post" button
- Refresh the page
- problem
Or you can immediately open the route "/post/2" to get an error. you can use any route "/post/N" where N is any number from 1 to 100
What is expected?
That the post will appear under the desired id entered in the address bar.
What is actually happening?
The post does not load, if you go through the vue-router to another page, then this page will also appear on other pages.
System Info
System:
OS: Linux 5.15 Linux Mint 21 (Vanessa)
CPU: (16) x64 Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz
Memory: 17.61 GB / 31.18 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 16.20.2 - /usr/bin/node
npm: 8.19.4 - /usr/bin/npm
Browsers:
Chrome: 118.0.5993.88
Chromium: 118.0.5993.88
npmPackages:
vue: ^3.3.4 => 3.3.6
Any additional comments?
I wanted to make it so that when a page with a certain message opens, and then the user closes the browser and opens it again, the message loads, and the user does not need to reopen the message he is interested in. The whole problem is that on the Create hook, from vuex, I am running the action "loadPostByID" in order for the record of the desired post to appear in the repository. When viewed via "Vue.js devtools", there is an entry in the repository, but it is not displayed. PS: I don't know how to work with local storage yet, so I'm implementing the functionality this way...
The errors I get:
postModule.js?t=1697996193838:60 [Vue warn]: Unhandled error during execution of render function
at <CurrentPostPage onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) {…} > >
at <RouterView>
at <App>
warn2 @ runtime-core.esm-bundler.js:41
logError @ runtime-core.esm-bundler.js:216
handleError @ runtime-core.esm-bundler.js:208
renderComponentRoot @ runtime-core.esm-bundler.js:853
componentUpdateFn @ runtime-core.esm-bundler.js:5767
run @ reactivity.esm-bundler.js:178
....
postModule.js?t=1697996193838:60 [Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core
at <CurrentPostPage onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) {…} > >
at <RouterView>
at <App>
warn2 @ runtime-core.esm-bundler.js:41
logError @ runtime-core.esm-bundler.js:216
handleError @ runtime-core.esm-bundler.js:208
callWithErrorHandling @ runtime-core.esm-bundler.js:160
flushJobs @ runtime-core.esm-bundler.js:357
....
CurrentPostPage.vue:4 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'title')
at Proxy._sfc_render (CurrentPostPage.vue:4:73)
at renderComponentRoot (runtime-core.esm-bundler.js:816:16)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5767:26)
at ReactiveEffect.run (reactivity.esm-bundler.js:178:19)
at instance.update (runtime-core.esm-bundler.js:5817:51)
at callWithErrorHandling (runtime-core.esm-bundler.js:158:32)
at flushJobs (runtime-core.esm-bundler.js:357:9)
....