Uncaught Error: Module parse failed: /... /node_modules/@ionic/app-scripts/dist/webpack/transpile-loader.js!/.../node_modules/epubjs/server.js Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #!/usr/bin/env node
| var connect = require('connect'),
| colors = require('colors'),
at Object.<anonymous> (vendor.js:109785)
at __webpack_require__ (bootstrap 84bf25b…:54)
at Object.28 (main.js:38)
at __webpack_require__ (bootstrap 84bf25b…:54)
at webpackJsonpCallback (bootstrap 84bf25b…:25)
at main.js:1
Hmm, seems like the server.js is inside the npm package and Webpack doesn’t know what to do with it - as it is specific code for nodejs, not for the client side.
Do you have any examples of this library being used in Angular/Ionic projects?
I have no experience with this stuff as well, so what comes now is pure flub with no idea if this is a good idea:
I copied the build folder from node_modules/epubjs to /assets/epubjs and included the .min.js in index.html directly, then I can use an ePub in home.ts to render a book (switched to local book because CORS stuff with remote book - remote should be fine on devices but not for ionic serve where I was testing). This actually renders the book! (although a bit broken because size doesn’t match - but that is details.