Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errorMessage": "Cannot read property 'href' of undefined (toc attribute not found in spine?) #13

Closed
ysa000 opened this issue Nov 13, 2019 · 2 comments

Comments

@ysa000
Copy link

ysa000 commented 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 😊

@ysa000 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
@gaoxiaoliangz
Copy link
Owner

Thanks for the feedback, I'll be woking on it when I have time.

@gaoxiaoliangz
Copy link
Owner

The new version(v2.0.2) is now released, this should have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants