Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve "warnOnce" #167

Open
info2programmer opened this issue May 2, 2020 · 7 comments
Open

Unable to resolve "warnOnce" #167

info2programmer opened this issue May 2, 2020 · 7 comments

Comments

@info2programmer
Copy link

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.

@jeevankumarkanuganti
Copy link

any update on this?

I am also facing the same issue

@info2programmer
Copy link
Author

No , I don't get any update

@jeevankumarkanuganti
Copy link

any workaround?

@Mubeen07
Copy link

me too facing same issue on this package

@tomkhenry
Copy link

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.

@swetha867
Copy link

swetha867 commented Feb 10, 2021

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>

@burak4ydin
Copy link

burak4ydin commented Feb 19, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants