Giter Site home page Giter Site logo

gerhardsletten / react-reader Goto Github PK

View Code? Open in Web Editor NEW
594.0 15.0 126.0 3.9 MB

An ePub-reader for React, powered by Epub.js

Home Page: https://react-reader.metabits.no

License: Apache License 2.0

JavaScript 1.33% HTML 1.42% TypeScript 96.60% CSS 0.65%
epub-reader reader react

react-reader's Introduction

React Reader - an easy way to embed a ePub into your webapp

React Reader is a react-wrapper for epub.js - an iframe based epub-reader that can run in browser, cordova and other web-based enviroments.

See demo

React Reader logo

Install

npm i react-reader

Usage

At the minimum you will need to give ReactReader you will need this:

  • An url that points to the epub-file
  • location (in epub) and a locationChanged function to store the change in location
  • Set a height for the container
import React, { useState } from 'react'
import { ReactReader } from 'react-reader'

export const App = () => {
  const [location, setLocation] = useState<string | number>(0)
  return (
    <div style={{ height: '100vh' }}>
      <ReactReader
        url="https://react-reader.metabits.no/files/alice.epub"
        location={location}
        locationChanged={(epubcfi: string) => setLocation(epubcfi)}
      />
    </div>
  )
}

This will render a reader like this:

Screnshot of React Reader

ReactReader props

  • title [string] - the title of the book, displayed above the reading-canvas
  • showToc [bool] - whether to show the toc / toc-nav
  • readerStyles [object] - override the default styles
  • epubViewStyles [object] - override the default styles for inner EpubView
  • swipeable [bool, default false] - enable swiping left/right with react-swipeable. Warning this will disable interacting with epub.js iframe content like selection

ReactReader props passed to inner EpubView

  • url [string, required] - url to the epub-file, if its on another domain, remember to add cors for the file. Epubjs fetch this by a http-call, so it need to be public available.
  • loadingView [element] - if you want to customize the loadingView
  • location [string, number, null] - set / update location of the epub
  • locationChanged [func] - a function that receives the current location while user is reading. This function is called everytime the page changes, and also when it first renders.
  • tocChanged [func] - when the reader has parsed the book you will receive an array of the chapters
  • epubInitOptions [object] - pass custom properties to the epub init function, see epub.js
  • epubOptions [object] - pass custom properties to the epub rendition, see epub.js's book.renderTo function
  • getRendition [func] - when epubjs has rendered the epub-file you can get access to the epubjs-rendition object here

EpubView props

EpubView is just the iframe-view from EpubJS if you would like to build the reader yourself, see above for props

Recipes and tips

TypeScript support

ReactReader is now fully written in Typescript, so your editor should give you information of types for all props.

(thanks to for earlier contributions @rafaelsaback)

Change font-size

See Basic example:

See demo / Source

Save and retrieve progress from storage

Use a state from local-storage.

See demo / Source

Customize styles for ReactReader

Override styles for ReactReader and Epub.js for multiple themes

See demo / Source

Display page number for current chapter

Epub.js is only rendering the current chapter so we can only get the current page and number of pages within this chapter.

See demo / Source

Hightlight selection in epub

This shows how to hook into epubJS annotations object and let the user highlight selection and store this in a list where user can go to a selection or delete it.

See demo / Source

Handling missing mime-types on server

EpubJS will try to parse the epub-file you pass to it, but if the server send wrong mine-types or the file does not contain .epub you can use the epubInitOptions prop to force reading it right.

import React from 'react'
import { ReactReader } from 'react-reader'

const App = () => {
  return (
    <div style={{ height: '100vh' }}>
      <ReactReader
        url="/my-epub-service"
        epubInitOptions={{
          openAs: 'epub',
        }}
      />
    </div>
  )
}

Display a scrolled epub-view

Pass options for this into epubJS in the prop epubOptions

See demo / Source

Quick reference for manager and flow options:

enum ManagerOptions {
  default = 'default', // Default setting, use when flow is set to auto/paginated.
  continuous = 'continuous', // Renders stuff offscreen, use when flow is set to "scrolled".
}

enum FlowOptions {
  default = 'auto', // Based on OPF settings, defaults to "paginated"
  paginated = 'paginated', // Left to right, paginated rendering. Better paired with the default manager.
  scrolled = 'scrolled', // Scrolled viewing, works best with "continuous" manager.
}

Things will look weird if you use the wrong manager/flow combination.

Limitations

EpubJS is a browser-based epub-reader and it works by rendering the current epub-chapter into an iframe, and then by css-columns it will display the current page.

  • EpubJS will need to render the current chapter before it will now how many pages it will have in the current viewport. Because of this it will not be able to tell you at which page in the whole epub-book you are at, nor will you be able to get the total pages for the whole book
  • Performance for a web-based epub-reader will not be the same as native readers.
  • EpubJS support epub 2 standard, but most epub 3 features should work since its based on regular html-tags, but there can be more issues with those See Epub on Wikipedia

Also be aware that the epub-standard is basically a zip of html-files, and there is a range in quality. Most publishers create pretty ok epubs, but in some older books there could be errors that will make rendering fails.

Handling not valid epub-files

A tip if you have problems with not valid epub-files is to override the build in DOMParser and modify the markup-string passed to its parseFromString function. This example fixes a not valid <title/> tag in an old epub, which would render as a blank page if not fixed:

const DOMParser = window.DOMParser

class OwnParser {
  parseFromString(markup, mime) {
    if (markup.indexOf('<title/>') !== -1) {
      markup = markup.replace('<title/>', '');
    }
    return new DOMParser().parseFromString(markup, mime)
  }
}

window.DOMParser = OwnParser

Enable opening links / running scripts inside epubjs iframe

Epubjs is rendering the epub-content inside and iframe which defaults to sandbox="allow-same-origin", to enable opening links or running javascript in an epub, you will need to pass some extra params in the epubOptions prop.

<ReactReader
  url={localFile}
  epubOptions={{
    allowPopups: true, // Adds `allow-popups` to sandbox-attribute
    allowScriptedContent: true, // Adds `allow-scripts` to sandbox-attribute
  }}
/>

react-reader's People

Contributors

alikazemkhanloo avatar aniketbiprojit avatar azu avatar dependabot[bot] avatar domszyn avatar eliot-akira avatar evanmuller avatar gerhardsletten avatar kimpers avatar krlvm avatar lamarcke avatar luciancic avatar nycynik avatar prasadpandari avatar rafaelsaback avatar renanvy avatar secretmapper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-reader's Issues

Error when using import { ReactReader } from "react-reader";

Fresh install.
react-native init epub1
npm install react-reader --save

change App.js with example:

<div style={{ position: "relative", height: "100%" }}>
        {" "}
        // * Container needs a height..
        <ReactReader
          url={"/alice.epub"}
          title={"Alice in wonderland"}
          location={"epubcfi(/6/2[cover]!/6)"}
          locationChanged={epubcifi => console.log(epubcifi)}
        />
      </div>

react-native run-ios

package.json
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.5",
"react-reader": "^0.17.11"
},
"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/runtime": "^7.6.0",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.4.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.8.6"
},

error: bundling failed: Error: Unable to resolve module stream from /Users/user/Sites/react-native/epub1/node_modules/jszip/lib/readable-stream-browser.js: Module stream does not exist in the Haste module map

This might be related to facebook/react-native#4968
To resolve try the following:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
  4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
    at ModuleResolver.resolveDependency (/Users/user/Sites/react-native/epub1/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:183:15)
    at ResolutionRequest.resolveDependency (/Users/user/Sites/react-native/epub1/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/user/Sites/react-native/epub1/node_modules/metro/src/node-haste/DependencyGraph.js:283:16)
    at Object.resolve (/Users/user/Sites/react-native/epub1/node_modules/metro/src/lib/transformHelpers.js:264:42)
    at dependencies.map.result (/Users/user/Sites/react-native/epub1/node_modules/metro/src/DeltaBundler/traverseDependencies.js:399:31)
    at Array.map ()
    at resolveDependencies (/Users/user/Sites/react-native/epub1/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:18)
    at /Users/user/Sites/react-native/epub1/node_modules/metro/src/DeltaBundler/traverseDependencies.js:269:33
    at Generator.next ()
    at asyncGeneratorStep (/Users/user/Sites/react-native/epub1/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

Font size

Hi!!!
First, congratulations for you great job. My question is, how do I change the font size to epub?

selection in readme code calls unknown function contents.mark

I'm using app code from the readme:

class App extends Component {
  render () {
    return (
      <div style={{position: 'relative', height: '100vh'}}> // * Container needs a height..
        <ReactReader
          url={'/harrypotter.epub'}
          title={'Harry Potter'}
          location={'epubcfi(/6/2[cover]!/6)'}
          locationChanged={(epubcifi) => console.log(epubcifi)}
          getRendition={this.getRendition}
        />
      </div>
    )
  }
  onRenditionSelection = (cfiRange, contents) => {
    console.log('Selection was created', cfiRange, contents)
    contents.mark(cfiRange, {}, (e) => {
      console.log('You clicked the selection')
    })
    contents.highlight(cfiRange)
    contents.window.getSelection().removeAllRanges()
  }
  getRendition = (rendition) => {
    // Get access to core events from epubjs
    rendition.on('selected', this.onRenditionSelection)
    // Add custom styles
    rendition.themes.default({
      '::selection': {
        'background': 'rgba(255,255,0, 0.3)'
      }
    })
  }
}

Getting the following exception:
TypeError: contents.mark is not a function
Rendition.App._this.onRenditionSelection
src/App.js:20

  17 | }
  18 | onRenditionSelection = (cfiRange, contents) => {
  19 |   console.log('Selection was created', cfiRange, contents)
> 20 |   contents.mark(cfiRange, {}, (e) => {
  21 |     console.log('You clicked the selection')
  22 |   })
  23 |   contents.highlight(cfiRange)

How to get a list of all pages given the current device resolution?

Hi,

I am trying to implement a slider allowing the user to go back and forth between the pages in the book, I also want to display a progression indicator for how far they have read.

With the vanilla epub.js this seems rather easily achievable according to their example, however I am not able to reproduce this in react-reader. Is there support for doing this in react-reader?

Thanks for a great library 👍

prevent copy event

How can I prevent copy events from the file which react-reader is showing? I set swipeable true to prevent the selection act. but now the user cannot scroll the book.

Ugllify Js error on building app while using react-reader dependency

I am using react-reader for Epub reader in my app, It works fine while i run the app like "node server.js" but it fails when i create the build of the app. I am getting error like
"Unexpected token name «of», expected punc «;»"
I have checked by removing import of react-reader and app build works fine.This was working fine in previous version of react-reader.
can anyone help me with this uglifyjs issue?

How to track page changing ?

Hi,
I'm using react-reader library.
Is it possible to get notice when page change, so I can start read later from the specific place?

Support highlight a text

Hi @gerhardsletten , I'm very interested in your project. I can use this to show ePub file well. But now I want to make a highlight of text in ePub file. I see that in ePubjs that support highlight function through a "hook". I don't know how to integrate it with your project.

Basically, I want to create a reader like this by react. It supports highlight and note function.
http://futurepress.github.io/epub.js/reader/

Can you teach me how to do it?

`

EPUBJS.Hooks.register("beforeChapterDisplay").highlight = function(callback, renderer){

// EPUBJS.core.addScript("js/libs/jquery.highlight.js", null, renderer.doc.head);

var s = document.createElement("style");
s.innerHTML =".highlight { background: yellow; font-weight: normal; }";

renderer.render.document.head.appendChild(s);

if(callback) callback();

}

`

[email protected] compile: `NODE_ENV=production babel --optional runtime -d lib/ src/modules/`

Yarn fails while trying to install.

> [email protected] compile /Users/[me]/Library/Caches/Yarn/v6/.tmp/794ac829897654d0b2ac52fbe6cd60d6.c7a13ea48e3a2fcefe172053d6ced9ca85a9dca0.prepare
> NODE_ENV=production babel --optional runtime -d lib/ src/modules/

error: unknown option '--optional'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] compile: `NODE_ENV=production babel --optional runtime -d lib/ src/modules/`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] compile script.

Some epub docs are not getting rendered by ReactReader component

Some epub docs are not getting rendered by ReactReader component and also it is not showing any errors in console.

Please find below sample .epub file which has the issue. Here am not able to upload directly .epub so compressed it to .zip.

a00041476en_us_2.zip

Page is coming up without doc content, below is the screenshot of the response.
image

Above .epub file is getting rendered by "EPUB File Reader" app and some other plugins also.

epubjs dependency breaks `react-scripts build`

I just started using the ReactReader component in an app today for the first time, and I was thrilled at how quickly I was able to start to render ePubs. So, thanks for putting this out there!

I encountered an issue, though, when I attempted to build the app to deploy it. I'm working with an app generated via create-react-app, with react-scripts 1.1.0.

The build errors out with the output:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file: 

 	./node_modules/epubjs/src/utils/core.js:71 

Read more here: http://bit.ly/2tRViJ9

That link suggests that the issue is that the epubjs library hasn't provided an ES5 version of their library. I haven't looked into epubjs before now, but it looks to me like the migration to ES6 is something they were doing on the v0.3 branch, which I see that react-reader uses, while the current released version (at least on npm) is still v0.2

So, maybe this ought to be an issue filed against that lib, but I thought I'd raise it here first to see if anyone else had encountered this when using react-reader.

Multipart ePub

Hello, Is there anyway to read multipart epub?

What i mean is I have epubs with multiple chapters and each as single single epub. But I want to show them as one runtime. Is it possible with this reader?

Toc redirection is not working

I have installed this package and trying to implement react reader with the given example file.Next and previous page functionality is working properly, but nothing happens on TOC item click. I also want to get the page number or some indicator that shows how far the user has reached on completing the book.

 import React, {Component} from 'react';
 import { ReactReader }  from 'react-reader';

 class Book extends Component { 
        constructor(props) {
             super(props);
        }

         getRendition = (rendition) => {
               // Get access to core events from epubjs
               rendition.on('selected', this.onRenditionSelection)
              // Add custom styles
              rendition.themes.default({
                      '::selection': {
                           'background': 'rgba(255,255,0, 0.3)'
                      }
              })
        }

        render(){
            return (
                  <div>
                   <div style={{height:'400px', position:relative'}}> 
                    <ReactReader
                        url={'https://s3-eu-west-1.amazonaws.com/react-reader/alice.epub'}
                        title={'Alice in wonderland'}
                        locationChanged={(epubcifi) => console.log(epubcifi)}
                        getRendition={this.getRendition}
                      />
                   </div>
                  </div>
            );
      }
}

export default Book;

On location change, i have log it on the console, that shows it like 'Chapter_001.xhtml', 'Chapter_002.xhtml', where as on next/previous click it shows diff format of location.
how can i fix it?
Thanks!

epub rendering issue.

I followed some steps to install react reader on mint system, that is as follows,

  1. i ran this react reader installation command
    npm install react-reader --save
  2. I copied below code in my app.js file.
    import React, { Component } from "react";
    import { ReactReader } from "react-reader";

class App extends Component {
render() {
return (
<div style={{ position: "relative", height: "100%" }}>
{" "}
// * Container needs a height..
<ReactReader
url={"/alice.epub"}
title={"Alice in wonderland"}
location={"epubcfi(/6/2[cover]!/6)"}
locationChanged={epubcifi => console.log(epubcifi)}
/>

);
}
}

after running server at http://localhost:3000 url, it rendered epub file with cover page. but it did not rendered epub pages when i clicked on each chapter from left navigation.
so i attached one screenshot for your reference. kindly check.

screenshot from 2019-02-12 16-32-15

Not working with S3 signed URL

Problem: S3 signed URL isn't working with react-reader, but working with epub.js if you specify the type exactly using openAs property.
Signed URL looks like http://localhost:9001/public/5114fa60-190d-11ea-b37e-c35bb6f93bd3-9785969114302.epub?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20191209%2F%2Fs3%2Faws4_request&X-Amz-Date=20191209T101525Z&X-Amz-Expires=432000&X-Amz-SignedHeaders=host&X-Amz-Signature=47671c3524be30eb23c01e92895ae5adebd683fb885f42fe7320ccfc2b975660

Solution: the problem with a function componentDidMount in src/modules/EpubView/EpubView.js. You need to send initial epubOptions props like epubOptions={openAs: 'epub'} but not an empty object.

No Section Found error

When i tried to load my epub file through react reader, it was not working. In console it was showing me below error message.
Unhandled promise rejection Error: "No Section Found"
_display http://localhost:3000/static/js/1.chunk.js:29432:27
dequeue http://localhost:3000/static/js/1.chunk.js:33605:20
run http://localhost:3000/static/js/1.chunk.js:33654:11
index.js:1446
d/console[e]
index.js:1446
onUnhandled/</result<
es6.promise.js:145
./node_modules/core-js/modules/_perform.js/module.exports
_perform.js:5
onUnhandled/<
es6.promise.js:136
./node_modules/core-js/modules/_invoke.js/module.exports
_invoke.js:7

_task.js:47
run
_task.js:27
listener

I kept my all xhtml file into OPS/Text folder.but when i moved all xhtml files from OPS/Text folder to OPS (root) folder and i updated content.opf file also. then epub file was rendering and working properly.

so i wanted to know that how to load or render all xhtml files from OPS/Text folder.
I attached two files such as measurement.zip file, this is original file and measurement (copy).zip file, this is modified file, after modification it was working. kindly check and let me know.

measurement.zip
measurement (copy).zip

display subitem of TOC

Thank you for your nice work.
But in your work, it seems cannot show the subitem of the table of contents.

Is it possible to do that? If it is possible. how should I do?

Expected a component class, got [object Object]

Hello,

I was trying to run your example from readme.

The only change I did it: export default class App extends Component ...

But during loading page I have an error: Expected a component class, got [object Object].

Could you please let me know is it my mistake (but its just an example) or I have to stick to another version?

Thank you,

Updates to epub.js v0.3.7 breaks react-reader

Will there be an update to react-reader as the new version of epub.js (0.3.7) breaks the reader. v0.3.7 with this error: rendition.js:198 Uncaught TypeError: this.ViewManager is not a constructor

Overriding styles on EpubView

Hi, in the docs it says to override default on EpubView
you can just pass styles prop but doing so, not only breaks the rendering of the page but
also no styles are being applied.

Steps to reproduce:
Adding styles prop to EpubView

<EpubView
    url={book.data.epub.file.uri}
    styles={{background: 'red'}}
/>

Any clarification on this?
Thank you 🙏🏼

Scrolling

Hello and thank you for all your work on this project.

I was wondering if it was possible to use a continuous scrolling view?

I keep trying to change the epuboptions, but to no avail. Is it possible with this or do I need to do something with the epub.js?

Problem with big epub files it take alot of time to load

Hi

Thanks for your great work , i'm using it in one of my app, one problem which i face when i have big epub file even if it is 8MB the loading time is around 10 second , i think it will load all 8MB and after that it show the page , isn't it better to load for example a part of epub not the whole so to take less time to show.

IE 11 issue

When try to open in IE 11 its rendering but not able to select any content

SCRIPT70: Permission denied
d9468a00-74c1-4d11-915c-f4c046ae0f6d (50050,4)

Looking to get page numbers

Trying to access the book underneath to render and get current page numbers as done here:

https://github.com/futurepress/epub.js/wiki/Tips-and-Tricks#generating-and-getting-page-numbers

Currently, I am using:

rendition.book.locations.generate(1024);
rendition.on(
'relocated',
function(locations) {
this.setState({
currentPage: rendition.book.locations.locationFromCfi(locations.start.cfi).toString(),
currentCfi: locations.start.cfi,
});
}.bind(this)
);

to get the current page, but the values do not seem to be correct and they change depending on the size of the window. Is there a way that I can access the book object to use the functions provided in the link above?

Update for new version of epubjs

Hi,
I tried to update epubjs version in package.json. But I get unexpected token 'export' error message in my nextjs app.
Is it possible for you to update the dependency for epubjs? The new version has some fixes for rtl books. I don't know what else I need to do.

Thanks.
Edit: the error is located in the last line in epubjs/libs/mime/mime.js. I manually edited and used commonjs format for exporting. still, I do not know how it is working in this package.

Uncaught (in promise) TypeError: json.map is not a function

First of all, thanks for this library, this is so awesome. I'm really excited to use it.

I'm trying to get the following example to work:

import React, { Component } from 'react';
import { ReactReader } from 'react-reader'

class Reader extends Component {
  render() {
    return (
      <div style={{position: 'relative', height: '100%'}}>
        <ReactReader
          url={'https://s3-eu-west-1.amazonaws.com/react-reader/alice.epub'}
          title={'Alice in wonderland'}
          location={'epubcfi(/6/2[cover]!/6)'}
          locationChanged={(epubcifi) => console.log(epubcifi)}
        />
      </div>
    )
  }
}


export default Reader

I'm using Facebook's create-react-app. Upon navigating to the route which loads this component, I get the following error:

image

I'm already importing babel-polyfill in my index.js. Am I missing something silly?

TOC uses incorrect refs

Reproduction sandbox: https://codesandbox.io/s/loving-dhawan-pl8z4

Open the TOC and click on one of the entries (e.g. Chapter 1)

Note that the following error appears in the console and the TOC item is not displayed:

rendition.js:397 Uncaught (in promise) Error: No Section Found
    at Rendition._display (rendition.js:397)
    at Queue.dequeue (queue.js:99)
    at queue.js:153

This seems to arise because it's trying to change location to "fcla-xml-2.30li8.xhtml", but the key for it in spineByHref is "xhtml/fcla-xml-2.30li8.xhtml"

Back incorrect epubcifi

Here, I have faced some troubles

When I use ReactReader with locationChanged function, it backed a path with .xhtml suffix and not epubcifi, the toc could not work too, hope notice this.

And another question is that I have not seen some usages about ReactReaderStyle, and how can I use it?

Showing “loading...” in Cordova app

Hi @gerhardsletten, not sure if this is an error related to react-reader or if it lies with my project—when running react-reader as a react web app, it loads epub files without any issues, but once I run my react app inside Cordova as an iOS app, the Loading... keeps displaying and not show the epub file.

ps. the /epub folder is located within the /www folder in Cordova.

<ReactReader
  url={'/epubs/' + lang + '-' + name + '.epub'}
/>

Any pointers would be greatly appreciated. And thank you for creating react-reader!

In IE 11 and Edge its not working

For my application I need this to work in IE11 and Edge, but its not working. I am always getting permission error. Is there any way by which I can make it work?

Imports failing

We're getting the following:

(function (exports, require, module, __filename, __dirname) { import EpubView from ‘./EpubView/EpubView’; ^^^^^^ SyntaxError: Unexpected token import

When we build to development with version 0.17. Believe it's something to do with this line:
const modules = NODE_ENV === 'production' ? false : 'commonjs'

Version 0.16.7 works but we also need the latest epubjs version which is not included with 0.16.7.

Some S3 links works, but other don't

Hey
I am having a problem where some S3 links works fine and I can render the EPUBs normally, but some links returns a Forbidden error and the link is not complete finishing with '/META-INF/container.xml'.

Working link seems like this
https://s3.sa-east-1.amazonaws.com/medcel.admin/pedagogical/books/5bd36de737a0784088c22cf4/CirurgiaGeralVol.2Extensivo2019.epub

not working link is very similar
https://s3.sa-east-1.amazonaws.com/medcel.admin/pedagogical/books/5ee7d7345a31d92a7d9f1ca5/pedagogicalbooks5ee7d7345a31d92a7d9f1ca5epubepub
This links returns this

Any ideia what could it be?

Error: No Section Found

Hello, running the project without making changes in the code I found the following error while executing the app in the console:

rendition.js:392 Uncaught (in promise) Error: No Section Found
at Rendition._display (rendition.js:392)
at Queue.dequeue (queue.js:99)
at queue.js:153

I changed epubjs version to see if it solved the problem and the same. Do you know what could be the problem ?
PD: at first the project do not worked and I had to change webpack-cli version to 3.1.1 to get it to work. but I think that this has not been related with the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.