edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.85k stars 157 forks source link

Cannot read properties of undefined (reading 'followingElementIDs') #2574

Closed panaC closed 1 month ago

panaC commented 1 month ago
[2]   readium-desktop:cli:command $0 path error : TypeError: Cannot read properties of undefined (reading 'followingElementIDs')
[2]     at initStore (/Users/edrlab/Documents/edrlab/projects/thorium-project/thorium-reader/dist/main.js:14900:33)
[2]     at async createStoreFromDi (/Users/edrlab/Documents/edrlab/projects/thorium-project/thorium-reader/dist/main.js:5526:35)
[2]     at async start (/Users/edrlab/Documents/edrlab/projects/thorium-project/thorium-reader/dist/main.js:16381:11)
[2]     at async Promise.all (index 0)
[2]     at async mainCommand (/Users/edrlab/Documents/edrlab/projects/thorium-project/thorium-reader/dist/main.js:4088:5)
[2]     at async Object.handler (/Users/edrlab/Documents/edrlab/projects/thorium-project/thorium-reader/dist/main.js:4175:5) +91ms
[2] $0 title ERROR: TypeError: Cannot read properties of undefined (reading 'followingElementIDs')

On macOS

Follow this commit https://github.com/edrlab/thorium-reader/commit/ba8fee09fd99f849ba68cef5616ffb788d808fa2#diff-600356d6a987e6ef5c15d0a38e75c5888e8483d82dd7e9e5fe7c875df4813e50L450

panaC commented 1 month ago

@danielweck I don't think it is expected, I did not investigate, yet

danielweck commented 1 month ago

damn, sorry. I think I know which one is triggering

danielweck commented 1 month ago

I added a precautionary guard against nil locator(Extended): https://github.com/edrlab/thorium-reader/commit/0ec741de31c5b913fcd8b0639598baec758c0f15 ...but I don't understand how a stored annotation doesn't have a locator?? I tested this code at my end and it worked fine, I guess you have some corrupted state at your end due to past experiments when your data model was evolving?