Jszip: How can I use jszip with Expo (React Native) ?

Created on 6 May 2018  路  5Comments  路  Source: Stuk/jszip

I get "unable to resolve module 'stream' when I try to use jszip in an Expo app.Expo is a javascript only version of React Native.

Most helpful comment

I fixed this error by installing the unresolved module. So npm i stream --save and then clearing cache and restarting watchman fixed the issue.

All 5 comments

I am getting this too:

ERROR in ./node_modules/jszip/lib/readable-stream-browser.js
Module not found: Error: Can't resolve 'stream'

I don't think it's related to a specific ui/js framework, as I am using angular6/devextreme while getting this error.

I expect it to be a problem with webpack 4 bundling maybe, as the error occures after upgrading from angular5 to angular6 which is using webpack 4.

Yes, having the same issue when building for angular6.

I think the issue is due to package.json main is pointing to ./lib/index which should point to dist folder instead.

@beeing
You can fix the angular build by adding node_modules/jszip/dist/jszip.min.js to the tsconfig -> compilerOptions -> paths

Has anyone figured out how to use jszip with react-native?

I fixed this error by installing the unresolved module. So npm i stream --save and then clearing cache and restarting watchman fixed the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davejack1 picture davejack1  路  4Comments

zizizi17 picture zizizi17  路  6Comments

Lsaes picture Lsaes  路  5Comments

sriramkp picture sriramkp  路  6Comments

carloscarcamo picture carloscarcamo  路  5Comments