0

I used Epubjs. But when I run the application. It turns out "Cannot read property 'requestContent' of undefined". Maybe it is about Asynchronous loading.` // @ is an alias to /src

import Epub from 'epubjs'

global.ePub = Epub
export default {
  name: 'home',
  mounted () {
    this.book = new Epub('/public/东京暗鸦_qinkan.net.epub')
    this.book.renderTo('read', {
      width: window.innerWidth,
      height: window.innerHeight
    })
  }
}
</script>`
pukka
  • 1
  • 1
  • Where you have accessed `requestContent`? Please provide that code snippet as well so it will be easy to understand your problem. – Yash Maheshwari Feb 21 '21 at 15:43

1 Answers1

0

I saw this issue in Chrome and loaded the new code into FF instead and it was showing me a Cross Origins blocked error (which makes sense because I hadn't added that to my API yet).

So this appears to be a chrome issue but might want to look into Cross-origin being blocked in your API.

Wild Bill
  • 51
  • 1
  • 3
  • Add link to this issue please – Dmitrii Sidenko Jun 22 '21 at 03:56
  • Apologies, poor choice of wording, it was not a Github issue but me personally experiencing the issue described by the OP. I personally saw this occur in Chrome but it was non-descript in helping me "why" I was seeing it. Loading the same code in FF I saw cross-origin blocked which was the reason for my code not working. So I made the comment in hopes that it would help people diagnose "Cannot read property 'requestContent' of undefined" – Wild Bill Jun 22 '21 at 05:41