epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

Failed to execute 'setStart' on 'Range': There is no child at offset.

Open askilondz opened this issue 6 years ago • 1 comments

This happens occasionally and I'm not sure what the fix is. Sometimes when I get the current CFI, save it, then try to go back to it I get an uncaught error inside epubjs where it is unable to find the offset from the CFI it gave me.

So here's a cfi that rendition.currentLocation().start.cfi returns: epubcfi(/6/18[xjos]!/4/10[JS0_0]/8/17:93)

Then if I try to load the CFI with rendition.display():

Unhandled Promise rejection: DOMException: Failed to execute 'setStart' on 'Range': There is no child at offset 93.

If I replace the :93 offset with :0 in the CFI it won't crash but obviously won't always load the correct page.

Any help is much appreciated.

askilondz avatar Nov 12 '19 21:11 askilondz

What is your final solution

xiaoli9y8 avatar Apr 06 '23 06:04 xiaoli9y8