epubjs-rn icon indicating copy to clipboard operation
epubjs-rn copied to clipboard

Unable to resolve "warnOnce"

Open info2programmer opened this issue 4 years ago • 7 comments

Unable to resolve "warnOnce" from "node_modules\epubjs-rn\node_modules\react-nat ive-zip-archive\node_modules\react-native\Libraries\react-native\react-native-im plementation.js" Failed building JavaScript bundle.

info2programmer avatar May 02 '20 07:05 info2programmer

any update on this?

I am also facing the same issue

jeevankumarkanuganti avatar Jul 17 '20 15:07 jeevankumarkanuganti

No , I don't get any update

info2programmer avatar Jul 17 '20 15:07 info2programmer

any workaround?

jeevankumarkanuganti avatar Jul 17 '20 15:07 jeevankumarkanuganti

me too facing same issue on this package

Mubeen07 avatar Jul 27 '20 19:07 Mubeen07

Hi! I was able to solve the problem by adding a blacklist in my metro.config.js. I found it here. Also I changed my react-native-webview to version 9.0.2, that seemed to work best.

tomkhenry avatar Feb 01 '21 18:02 tomkhenry

Workaround It worked using epubjs library and react-native-webview. epubjs react-native-webview

<WebView 
  ref={webview}
  source={{ uri:'file:///android_asset/epub_renderer.html'}}  />

Add epub_renderer.html in "\android\app\src\main\assets" folder of project

<body>
	<div id="area"></div>
</body>
<script>
       var book = ePub("path/book.epub");
       var rendition = book.renderTo("area", {width: 600, height: 400});
       var displayed = rendition.display();
</script>

swetha867 avatar Feb 10 '21 23:02 swetha867

change your metro.config.js

to:

const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = { resolver: { blacklistRE: blacklist([/node_modules/./node_modules/react-native/./]) }, transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false } }) } };

And change your webview version to -> 9.0.2

And also use -> @ottofeller/epubjs-rn

https://www.npmjs.com/package/@ottofeller/epubjs-rn

import {Epub} from '@ottofeller/epubjs-rn'

Dont forget width and height

burak4ydin avatar Feb 19 '21 09:02 burak4ydin