You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encountered the following error while parsing an ePub:
errorMessage": "Cannot read property 'href' of undefined", "errorType": "TypeError", "stackTrace": [ "TypeError: Cannot read property 'href' of undefined", " at Epub.<anonymous> (/Users/xx/Desktop/workspaces/xxx/node_modules/@gxl/epub-parser/src/parseEpub.ts:185:52)",
I think that the above issue might be because of the toc attribute not being found in the <spine /> tag. I've tried removing the unused attribute in the .opf file, and replaced it with the expected toc attribute, and I did not have the error anymore.
The ePub 3.2 specifications points out the toc attribute is optional in the <spine />. Instead of breaking, shouldn't it advisable to continue the parsing process when the attribute is not found ?
Thanks in advance @gaoxiaoliangz for your reply and keep up the good work 😊
The text was updated successfully, but these errors were encountered:
ysa000
changed the title
errorMessage": "Cannot read property 'href' of undefined - toc attribute not found in spine
errorMessage": "Cannot read property 'href' of undefined (toc attribute not found in spine?)
Nov 13, 2019
Hello @gaoxiaoliangz,
I have encountered the following error while parsing an ePub:
errorMessage": "Cannot read property 'href' of undefined", "errorType": "TypeError", "stackTrace": [ "TypeError: Cannot read property 'href' of undefined", " at Epub.<anonymous> (/Users/xx/Desktop/workspaces/xxx/node_modules/@gxl/epub-parser/src/parseEpub.ts:185:52)",
I think that the above issue might be because of the
toc
attribute not being found in the<spine />
tag. I've tried removing the unused attribute in the .opf file, and replaced it with the expected toc attribute, and I did not have the error anymore.The ePub 3.2 specifications points out the
toc
attribute is optional in the<spine />
. Instead of breaking, shouldn't it advisable to continue the parsing process when the attribute is not found ?Thanks in advance @gaoxiaoliangz for your reply and keep up the good work 😊
The text was updated successfully, but these errors were encountered: