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

ReferenceError: ePub is not defined

Open prographo opened this issue 6 years ago • 2 comments

Hi,

I cloned the github into my document root directory.

I navigated the browser to /examples/spreads.html

The error in the console is: ReferenceError: ePub is not defined

This is the line:

// Load the opf var book = ePub(url || "https://s3.amazonaws.com/moby-dick/moby-dick.epub");

I did a wget on the URL and indeed the file is there.

Any clue what is problem?

prographo avatar Feb 21 '19 15:02 prographo

because the epubjs library is not included in the github project and the example files are loading it from ../dist/epub.js - look the html header element To make it work there is multiple solutions:

  • Manually build the project then use the output javascript file
  • change the included file to load the source files
  • And the easiest way is to do npm install epubjs --save then navigate to node_modules/epubjs/dist and use the one that the developers uploaded to npmjs

wnabil avatar Apr 09 '19 16:04 wnabil

hi, what does it mean "use the one that the developers uploaded to npmjs", cause i do see that there is an epub.js file in my node modules?

eyalgromzin avatar Mar 12 '22 12:03 eyalgromzin