danang-id / simple-crypto-js

Simplified AES cryptography for safer and easier encryption and decryption processes of any JavaScript objects.
https://simplecrypto.js.org
MIT License
85 stars 27 forks source link

Not working anymore in React Native / Expo #24

Closed enguerranws closed 4 years ago

enguerranws commented 4 years ago

Hi,

Since I updated from 2.2.0 to 2.4, my Expo (React Native) app, stopped working properly, throwing this error on decrypt:

The package at "node_modules/crypto-js/core.js" attempted to import the Node standard library module "crypto". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo
Failed building JavaScript bundle.

Any idea how to fix that?

danang-id commented 4 years ago

It is because crypto-js lib version 4.0.0 used internally in this library is having a breaking changes that makes SimpleCrypto won't be able to run without native crypto module such as IE 10 or React Native. Please read more here.

We will probably publish two new releases, version 2.5.0 with crypto-js rollbacked to 3.3.0 to maintain compatibility and version 3.0.0 with current crypto-js 4.0.0.

danang-id commented 4 years ago

We will probably publish two new releases, version 2.5.0 with crypto-js rollbacked to 3.3.0 to maintain compatibility and version 3.0.0 with current crypto-js 4.0.0.

@enguerranws Expects the new release of version 2.5.0 within a day. For now, please stay at 2.2.0.

enguerranws commented 4 years ago

Wow, thank you really much for this quick answer. I'm looking forward to this version.

danang-id commented 4 years ago

@enguerranws SimpleCrypto v2.5.0 is now available with compatibility support for IE 10 and React Native. Please do upgrade because v2.2.0 is vulnerable.