satorumurmur / bibi

Bibi | EPUB Reader on your website.
https://bibi.epub.link
MIT License
833 stars 123 forks source link

Some epub won't load when bibi.js can't set it's style. #150

Open linkinstreet opened 3 months ago

linkinstreet commented 3 months ago

Hi, I have using bibi epub reader for a while, and I noticed that there are a few epub that I have can't be loaded with bibi for some reason, And all have the same error.

"Cannot read properties of undefined (reading 'style')"

`Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'style')

at Object.setStyle (bibi.js:11:6983)

at g.style (bibi.js:11:8276)

at Object.renderReflowableItem (bibi.js:11:77082)

at bibi.js:11:76687

at new Promise (<anonymous>)

at Object.layOutItem (bibi.js:11:76611)

at Object.layOutSpreadAndItsItems (bibi.js:11:73287)

at bibi.js:11:44260`

Since the javascript has been made to be just one line, I am having problem understanding what causes this issue. My best guess is that bibi fails to read the style (css?) file of the epub, and just stopped. Are there any ways for me to make so that if bibi encounters a style issue, it just loads a default stylesheet instead?

Thank you