memos
memos copied to clipboard
Unhandled Thrown Error! Cannot read properties of undefined (reading 'count')
Hi, when I open memos today, there are some error log displayed on the page and can not view my memos. here are some error logs below. (version 0.4.5)
Unhandled Thrown Error!
Cannot read properties of undefined (reading 'count')
TypeError: Cannot read properties of undefined (reading 'count')
at https://xxx.xx/assets/index.f618fa86.js:107:19652
at Qs (https://xxx.xx/assets/index.f618fa86.js:32:24425)
at ci (https://xxx.xx/assets/index.f618fa86.js:32:42666)
at S9 (https://xxx.xx/assets/index.f618fa86.js:32:41472)
at so (https://xxx.xx/assets/index.f618fa86.js:32:40498)
at ty (https://xxx.xx/assets/index.f618fa86.js:32:37079)
at Xn (https://xxx.xx/assets/index.f618fa86.js:30:3274)
at https://xxx.xx/assets/index.f618fa86.js:32:34432
💿 Hey developer 👋
You can provide a way better UX than this when your app throws errors by providing your own errorElement props on <Route>
@theChrisWei Sorry, I cannot reproduce on my local computer and demo. Could you please join the telegram group and send me your database file (desensitized first)?
sure, I will pm u on tg.
After some talks in telegram, it might be a cache problem from vite-plugin-pwa
. And it had been removed: https://github.com/usememos/memos/commit/a2180f177fdd2e0637cb9ffa04656c8e4275131d
@boojack I have the same issue/error after upgrade to the latest v0.5.0..
@boojack I have the same issue/error after upgrade to the latest v0.5.0..
yep, i can still reproduce on v0.5.0
If you encounter the same error, please clear your browser cache. If not, give me the details of the error.
@boojack It is a similar error as above, the browser cache has been cleared, but no luck. Also tried in mobile and another computer, but it is the same error.
Environment:
- Memos has been set up via docker in a Synology
- Win 10 64bit, Edge Version 106.0.1370.34 (Official build) (64-bit)
The below error appears when fetching data after logging in.
@DHS1001 Could you please join the telegram group and send me your database file (desensitized first)?
@boojack
One more finding is the explore
page works properly.
Looking at the docker log:
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
Version 0.5.0 has started at :5230
{"time":"2022-10-11T10:29:48Z","method":"GET","uri":"/auth","status":200,"error":""}
{"time":"2022-10-11T10:29:48Z","method":"GET","uri":"/assets/index.19a074d4.css","status":200,"error":""}
{"time":"2022-10-11T10:29:48Z","method":"GET","uri":"/assets/index.06aad460.js","status":200,"error":""}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/logo-full.webp","status":200,"error":""}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/api/user/me","status":401,"error":"code=401, message=Missing user in session"}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/api/status","status":200,"error":""}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/sw.js","status":200,"error":""}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/logo.webp","status":200,"error":""}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/manifest.json","status":200,"error":""}
{"time":"2022-10-11T10:29:49Z","method":"GET","uri":"/logo.webp","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"POST","uri":"/api/auth/signin","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"GET","uri":"/api/user/me","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"GET","uri":"/api/status","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"GET","uri":"/api/user/me","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"GET","uri":"/api/shortcut?","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"GET","uri":"/api/memo?rowStatus=NORMAL","status":200,"error":""}
{"time":"2022-10-11T10:29:52Z","method":"GET","uri":"/logo.webp","status":200,"error":""}
{"time":"2022-10-11T10:29:53Z","method":"GET","uri":"/api/tag?","status":200,"error":""}
...
...
From the db structure, the NOT working db file is missing the below three triggers compare with the fresh install db file.
And the memo_resource
table in the NOT working db file has no records, with the resource
table has records after the migration to 0.5.
@DHS1001 Thanks for your so detailed report, I will take a deep look as soon as possible.
Thanks @boojack, hope this is helpful to identify the root cause and get this issue resolved. Feel free to let me know if you need more information.
@DHS1001
- For these missing triggers, I have upserted a patch into
0.5.0
image and will re-create all of them in0.6.0
. - And it is normal that the
memo_resource
table has no records. The table is using for saving the relatedresource
withmemo
, so it should be empty in the latest version.
Thanks for the quick fix @boojack
Looking forward to version 0.6.0
@DHS1001 v0.6.0
has been released. FYI
Thanks @boojack, the issue still persists after the upgrade to v0.6.0
unfortunately.
Unhandled Thrown Error!
Cannot read properties of undefined (reading 'count')
Anything more we can check to find the cause or this issue?
Thanks @boojack, the issue still persists after the upgrade to
v0.6.0
unfortunately.
Could you please clean the browser cache firstly or check it in private mode?
Could you please clean the browser cache firstly or check it in private mode?
@boojack Tried to clear the cache, and ran in edge InPrivate windows, the same error appeared.
Could you please clean the browser cache firstly or check it in private mode?
@boojack Tried to clear the cache, and ran in edge InPrivate windows, the same error appeared.
@boojack Tried same approach(clear che cache) as @DHS1001, the issue still exists. 100% reproduce scene: after I change the date of some memo(say change today memo's date to 2022-09-09) and refresh the page, the exception happen (my timezone is New Zealand Daylight Time). I can share via screen sharing if u need.
Unhandled Thrown Error!
Cannot read properties of undefined (reading 'count')
@DHS1001 It looks like a front-end error message, can you give me the details of an error network request?
@DHS1001 @AlwaysKris I think a quick way to solve this problem is to use the latest database schema. You can save your old database file and generate a new one, then copy the old data to the new one.
Thanks @boojack, Looks like the issue is resolved after the upgrade to v0.6.1.